summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)