lavc: reimplement avcodec_get_name with descriptors.

This commit is contained in:
Nicolas George
2012-08-13 11:27:20 +02:00
parent 690ef618b1
commit 9bb936a80e
3 changed files with 4 additions and 97 deletions

View File

@@ -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;