diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-24 01:31:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-24 01:31:54 +0200 |
commit | 1bc81bf981552ec542e14af194cd05d7c74a83e1 (patch) | |
tree | c69c65bb7be6f86b77e6c141bd50fb0cec0375ea /libavcodec/utils.c | |
parent | df0adc806b77a6e0cb9293a5002ed00788436f68 (diff) | |
download | ffmpeg-streaming-1bc81bf981552ec542e14af194cd05d7c74a83e1.zip ffmpeg-streaming-1bc81bf981552ec542e14af194cd05d7c74a83e1.tar.gz |
avcodec_find_decoder: prefer non experimental decoders.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index aecfb8a..9dcc4a8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -903,14 +903,18 @@ AVCodec *avcodec_find_encoder_by_name(const char *name) AVCodec *avcodec_find_decoder(enum CodecID id) { - AVCodec *p; + AVCodec *p, *experimental=NULL; p = first_avcodec; while (p) { - if (p->decode != NULL && p->id == id) - return p; + if (p->decode != NULL && p->id == id) { + if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) { + experimental = p; + } else + return p; + } p = p->next; } - return NULL; + return experimental; } AVCodec *avcodec_find_decoder_by_name(const char *name) |