summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-02 17:04:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-02 18:53:50 +0100
commit913bc7996e7cb6bd8616d0a2758e715ee912831f (patch)
treedfb0d8efefb18bd0b0a81d532f8f72e325db6a13
parentd66ee6ac4898b8af2f9c39bd0893e89e823286ac (diff)
lavc: fix avcodec_get_type()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c6
1 files changed, 6 insertions, 0 deletions
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)