summaryrefslogtreecommitdiff
path: root/libavcodec/codec_desc.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-09-26 18:42:50 +0200
committerAnton Khirnov <anton@khirnov.net>2015-09-28 10:50:38 +0200
commita5d58fea68b9212e0065a71939e921505504a9bb (patch)
treeaa6b964ddca049ecfdd636523036cdfb91babb2d /libavcodec/codec_desc.c
parentb10b6ac7a902f28e09e37a29c392e2f0c19e9526 (diff)
downloadffmpeg-a5d58fea68b9212e0065a71939e921505504a9bb.tar.gz
lavc: reimplement avcodec_get_type() using codec descriptors
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/codec_desc.c')
-rw-r--r--libavcodec/codec_desc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index c1be40bd85..31d3555c25 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2435,3 +2435,9 @@ const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name)
return desc;
return NULL;
}
+
+enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
+{
+ const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
+ return desc ? desc->type : AVMEDIA_TYPE_UNKNOWN;
+}