[FFmpeg-cvslog] lavc: fix avcodec_get_type()

Michael Niedermayer git at videolan.org
Wed Nov 2 19:01:32 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov  2 17:04:46 2011 +0100| [913bc7996e7cb6bd8616d0a2758e715ee912831f] | committer: Michael Niedermayer

lavc: fix avcodec_get_type()

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

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

 libavcodec/utils.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e494226..1ad87f1 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1436,6 +1436,12 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count)
 
 enum AVMediaType avcodec_get_type(enum CodecID codec_id)
 {
+    AVCodec *c= avcodec_find_decoder(codec_id);
+    if(!c)
+        c= avcodec_find_encoder(codec_id);
+    if(c)
+        return c->type;
+
     if (codec_id <= CODEC_ID_NONE)
         return AVMEDIA_TYPE_UNKNOWN;
     else if (codec_id < CODEC_ID_FIRST_AUDIO)



More information about the ffmpeg-cvslog mailing list