From 913bc7996e7cb6bd8616d0a2758e715ee912831f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 2 Nov 2011 17:04:46 +0100 Subject: [PATCH] lavc: fix avcodec_get_type() Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e4942263d6..1ad87f1b9d 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)