[FFmpeg-cvslog] avcodec_find_decoder: prefer non experimental decoders.

Michael Niedermayer git at videolan.org
Tue May 24 02:02:39 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 24 01:31:15 2011 +0200| [1bc81bf981552ec542e14af194cd05d7c74a83e1] | committer: Michael Niedermayer

avcodec_find_decoder: prefer non experimental decoders.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bc81bf981552ec542e14af194cd05d7c74a83e1
---

 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)



More information about the ffmpeg-cvslog mailing list