mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 11:47:45 +00:00
av_common: cosmetic simplification to ffmpeg component iteration loops
This commit is contained in:
parent
428fc1cbef
commit
596f66cccf
@ -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,
|
static void add_codecs(struct mp_decoder_list *list, enum AVMediaType type,
|
||||||
bool decoders)
|
bool decoders)
|
||||||
{
|
{
|
||||||
const AVCodec *cur = NULL;
|
|
||||||
void *iter = NULL;
|
void *iter = NULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
cur = av_codec_iterate(&iter);
|
const AVCodec *cur = av_codec_iterate(&iter);
|
||||||
if (!cur)
|
if (!cur)
|
||||||
break;
|
break;
|
||||||
if (av_codec_is_decoder(cur) == decoders &&
|
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 **mp_get_lavf_demuxers(void)
|
||||||
{
|
{
|
||||||
char **list = NULL;
|
char **list = NULL;
|
||||||
const AVInputFormat *cur = NULL;
|
|
||||||
void *iter = NULL;
|
void *iter = NULL;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
cur = av_demuxer_iterate(&iter);
|
const AVInputFormat *cur = av_demuxer_iterate(&iter);
|
||||||
if (!cur)
|
if (!cur)
|
||||||
break;
|
break;
|
||||||
MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, cur->name));
|
MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, cur->name));
|
||||||
|
Loading…
Reference in New Issue
Block a user