aboutsummaryrefslogtreecommitdiffhomepage
path: root/common
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2018-04-03 18:06:23 +0200
committerGravatar Jan Ekström <jeebjp@gmail.com>2018-04-03 20:08:15 +0300
commit596f66cccf0e8959dc1fc04435358622272c0433 (patch)
tree2908f1da475b671e4b7d47fc080a73367d4586eb /common
parent428fc1cbeff232f57a5e67a1dd1bd9112ad39509 (diff)
av_common: cosmetic simplification to ffmpeg component iteration loops
Diffstat (limited to 'common')
-rw-r--r--common/av_common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/av_common.c b/common/av_common.c
index 00c7d79a74..2c959ffe4f 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -222,10 +222,9 @@ void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads
static void add_codecs(struct mp_decoder_list *list, enum AVMediaType type,
bool decoders)
{
- const AVCodec *cur = NULL;
void *iter = NULL;
for (;;) {
- cur = av_codec_iterate(&iter);
+ const AVCodec *cur = av_codec_iterate(&iter);
if (!cur)
break;
if (av_codec_is_decoder(cur) == decoders &&
@@ -251,11 +250,10 @@ void mp_add_lavc_encoders(struct mp_decoder_list *list)
char **mp_get_lavf_demuxers(void)
{
char **list = NULL;
- const AVInputFormat *cur = NULL;
void *iter = NULL;
int num = 0;
for (;;) {
- cur = av_demuxer_iterate(&iter);
+ const AVInputFormat *cur = av_demuxer_iterate(&iter);
if (!cur)
break;
MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, cur->name));