Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-04 18:13:21 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2016-01-04 18:13:21 +0300
commit526cac14b0b9f0f124d1e6d9d4400d01fca89da8 (patch)
tree7dad46d1d8e8b22c064df8c962e64ea4f1194265
parent95eea1d14fdd71271963dc16f5f7c49cd6b6368b (diff)
Use codec descriptor for codec names
-rw-r--r--demuxer/Demuxers/LAVFUtils.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/demuxer/Demuxers/LAVFUtils.cpp b/demuxer/Demuxers/LAVFUtils.cpp
index 510c2cce..a042b28a 100644
--- a/demuxer/Demuxers/LAVFUtils.cpp
+++ b/demuxer/Demuxers/LAVFUtils.cpp
@@ -100,8 +100,9 @@ std::string get_codec_name(AVCodecContext *pCodecCtx)
AVCodecID id = pCodecCtx->codec_id;
// Grab the codec
- AVCodec *p = avcodec_find_decoder(id);
- const char *profile = p ? av_get_profile_name(p, pCodecCtx->profile) : nullptr;
+ const AVCodec *p = avcodec_find_decoder(id);
+ const AVCodecDescriptor *desc = avcodec_descriptor_get(id);
+ const char *profile = avcodec_profile_name(id, pCodecCtx->profile);
std::ostringstream codec_name;
@@ -138,12 +139,14 @@ std::string get_codec_name(AVCodecContext *pCodecCtx)
codec_name << nice_name;
if (profile)
codec_name << " " << tolower(profile);
+ } else if (desc && desc->name) {
+ codec_name << desc->name;
+ if (profile)
+ codec_name << " " << tolower(profile);
} else if (p && p->name) {
codec_name << p->name;
if (profile)
codec_name << " " << tolower(profile);
- } else if (pCodecCtx->codec_name[0] != '\0') {
- codec_name << pCodecCtx->codec_name;
} else {
/* output avi tags */
char buf[32];