[FFmpeg-cvslog] avformat/matroska: Move mime_tag lists to matroskadec

Andreas Rheinhardt git at videolan.org
Mon Apr 20 22:27:33 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Apr 16 03:39:05 2020 +0200| [67e957b43a2fdc197018968b0adc2f6a9c04e961] | committer: Andreas Rheinhardt

avformat/matroska: Move mime_tag lists to matroskadec

They are not used any more by the muxer.

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

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

 libavformat/matroska.c    | 19 -------------------
 libavformat/matroska.h    |  2 --
 libavformat/matroskadec.c | 35 +++++++++++++++++++++++++++--------
 3 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 4d18d147fc..7c56aba403 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -119,25 +119,6 @@ const CodecTags ff_webm_codec_tags[] = {
     {""                 , AV_CODEC_ID_NONE}
 };
 
-const CodecMime ff_mkv_image_mime_tags[] = {
-    {"image/gif"                  , AV_CODEC_ID_GIF},
-    {"image/jpeg"                 , AV_CODEC_ID_MJPEG},
-    {"image/png"                  , AV_CODEC_ID_PNG},
-    {"image/tiff"                 , AV_CODEC_ID_TIFF},
-
-    {""                           , AV_CODEC_ID_NONE}
-};
-
-const CodecMime ff_mkv_mime_tags[] = {
-    {"text/plain"                 , AV_CODEC_ID_TEXT},
-    {"application/x-truetype-font", AV_CODEC_ID_TTF},
-    {"application/x-font"         , AV_CODEC_ID_TTF},
-    {"application/vnd.ms-opentype", AV_CODEC_ID_OTF},
-    {"binary"                     , AV_CODEC_ID_BIN_DATA},
-
-    {""                           , AV_CODEC_ID_NONE}
-};
-
 const AVMetadataConv ff_mkv_metadata_conv[] = {
     { "LEAD_PERFORMER", "performer" },
     { "PART_NUMBER"   , "track"  },
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index e177cd027f..6f198f06e6 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -362,8 +362,6 @@ typedef struct CodecTags{
 
 extern const CodecTags ff_mkv_codec_tags[];
 extern const CodecTags ff_webm_codec_tags[];
-extern const CodecMime ff_mkv_mime_tags[];
-extern const CodecMime ff_mkv_image_mime_tags[];
 extern const AVMetadataConv ff_mkv_metadata_conv[];
 extern const char * const ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB];
 extern const char * const ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT];
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 761d8b3743..8e1326abf6 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -747,6 +747,25 @@ static EbmlSyntax matroska_cluster_enter[] = {
 };
 #undef CHILD_OF
 
+static const CodecMime mkv_image_mime_tags[] = {
+    {"image/gif"                  , AV_CODEC_ID_GIF},
+    {"image/jpeg"                 , AV_CODEC_ID_MJPEG},
+    {"image/png"                  , AV_CODEC_ID_PNG},
+    {"image/tiff"                 , AV_CODEC_ID_TIFF},
+
+    {""                           , AV_CODEC_ID_NONE}
+};
+
+static const CodecMime mkv_mime_tags[] = {
+    {"text/plain"                 , AV_CODEC_ID_TEXT},
+    {"application/x-truetype-font", AV_CODEC_ID_TTF},
+    {"application/x-font"         , AV_CODEC_ID_TTF},
+    {"application/vnd.ms-opentype", AV_CODEC_ID_OTF},
+    {"binary"                     , AV_CODEC_ID_BIN_DATA},
+
+    {""                           , AV_CODEC_ID_NONE}
+};
+
 static const char *const matroska_doctypes[] = { "matroska", "webm" };
 
 static int matroska_read_close(AVFormatContext *s);
@@ -2882,10 +2901,10 @@ static int matroska_read_header(AVFormatContext *s)
             av_dict_set(&st->metadata, "mimetype", attachments[j].mime, 0);
             st->codecpar->codec_id   = AV_CODEC_ID_NONE;
 
-            for (i = 0; ff_mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
-                if (!strncmp(ff_mkv_image_mime_tags[i].str, attachments[j].mime,
-                             strlen(ff_mkv_image_mime_tags[i].str))) {
-                    st->codecpar->codec_id = ff_mkv_image_mime_tags[i].id;
+            for (i = 0; mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
+                if (!strncmp(mkv_image_mime_tags[i].str, attachments[j].mime,
+                             strlen(mkv_image_mime_tags[i].str))) {
+                    st->codecpar->codec_id = mkv_image_mime_tags[i].id;
                     break;
                 }
             }
@@ -2913,10 +2932,10 @@ static int matroska_read_header(AVFormatContext *s)
                 memcpy(st->codecpar->extradata, attachments[j].bin.data,
                        attachments[j].bin.size);
 
-                for (i = 0; ff_mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
-                    if (!strncmp(ff_mkv_mime_tags[i].str, attachments[j].mime,
-                                strlen(ff_mkv_mime_tags[i].str))) {
-                        st->codecpar->codec_id = ff_mkv_mime_tags[i].id;
+                for (i = 0; mkv_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {
+                    if (!strncmp(mkv_mime_tags[i].str, attachments[j].mime,
+                                strlen(mkv_mime_tags[i].str))) {
+                        st->codecpar->codec_id = mkv_mime_tags[i].id;
                         break;
                     }
                 }



More information about the ffmpeg-cvslog mailing list