aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-24 01:31:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-24 01:31:54 +0200
commit1bc81bf981552ec542e14af194cd05d7c74a83e1 (patch)
treec69c65bb7be6f86b77e6c141bd50fb0cec0375ea
parentdf0adc806b77a6e0cb9293a5002ed00788436f68 (diff)
downloadffmpeg-1bc81bf981552ec542e14af194cd05d7c74a83e1.tar.gz
avcodec_find_decoder: prefer non experimental decoders.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index aecfb8af33..9dcc4a8105 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)