aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-08-13 11:27:20 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-08-14 11:35:30 +0200
commit9bb936a80e72ae3439ded56f08f3d558700537c2 (patch)
tree7de758924c81f745e8e7eddb23493f95f8754295 /libavcodec/utils.c
parent690ef618b1b0deae8a63ff7f3e4517c4adb70929 (diff)
downloadffmpeg-9bb936a80e72ae3439ded56f08f3d558700537c2.tar.gz
lavc: reimplement avcodec_get_name with descriptors.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 90df647db7..03caf1c026 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1847,14 +1847,13 @@ AVCodec *avcodec_find_decoder_by_name(const char *name)
const char *avcodec_get_name(enum AVCodecID id)
{
+ const AVCodecDescriptor *cd;
AVCodec *codec;
-#if !CONFIG_SMALL
- switch (id) {
-#include "libavcodec/codec_names.h"
- }
+ cd = avcodec_descriptor_get(id);
+ if (cd)
+ return cd->name;
av_log(NULL, AV_LOG_WARNING, "Codec 0x%x is not in the full list.\n", id);
-#endif
codec = avcodec_find_decoder(id);
if (codec)
return codec->name;