[FFmpeg-cvslog] avformat/webmdashenc: Use AVCodecDescriptors for codec names

Andreas Rheinhardt git at videolan.org
Tue Apr 7 16:04:13 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Mar 30 03:09:41 2020 +0200| [1719c7f5db233a7efb2b55d7299d30f32061499b] | committer: Andreas Rheinhardt

avformat/webmdashenc: Use AVCodecDescriptors for codec names

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1719c7f5db233a7efb2b55d7299d30f32061499b
---

 libavformat/webmdashenc.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index 016de8af6b..08fe976b15 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -61,17 +61,7 @@ typedef struct WebMDashMuxContext {
 
 static const char *get_codec_name(int codec_id)
 {
-    switch (codec_id) {
-        case AV_CODEC_ID_VP8:
-            return "vp8";
-        case AV_CODEC_ID_VP9:
-            return "vp9";
-        case AV_CODEC_ID_VORBIS:
-            return "vorbis";
-        case AV_CODEC_ID_OPUS:
-            return "opus";
-    }
-    return NULL;
+    return avcodec_descriptor_get(codec_id)->name;
 }
 
 static double get_duration(AVFormatContext *s)



More information about the ffmpeg-cvslog mailing list