]> git.sesse.net Git - ffmpeg/commitdiff
lavc: print the name of the codec, not its implementation, in avcodec_string
authorAnton Khirnov <anton@khirnov.net>
Tue, 30 Dec 2014 11:44:02 +0000 (12:44 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sat, 12 Dec 2015 20:21:54 +0000 (21:21 +0100)
libavcodec/utils.c

index 4f2f951069712cf12ebe37d8a5f9c7d1ce69ac4a..af2835e8b9f919ec8ece41c9ba1099665302a691 100644 (file)
@@ -1754,6 +1754,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
     int bitrate;
     int new_line = 0;
     AVRational display_aspect_ratio;
+    const AVCodecDescriptor *desc = avcodec_descriptor_get(enc->codec_id);
 
     if (enc->codec)
         p = enc->codec;
@@ -1762,9 +1763,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
     else
         p = avcodec_find_decoder(enc->codec_id);
 
-    if (p) {
-        codec_name = p->name;
+    if (p)
         profile = av_get_profile_name(p, enc->profile);
+
+    if (desc) {
+        codec_name = desc->name;
     } else if (enc->codec_id == AV_CODEC_ID_MPEG2TS) {
         /* fake mpeg2 transport stream codec (currently not
          * registered) */