[FFmpeg-cvslog] id3v2: reduce the scope of some non-globally-used symbols/structures

Diego Biurrun git at videolan.org
Fri Oct 14 03:58:32 CEST 2011


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon Oct 10 15:51:02 2011 +0200| [c4a378855e7a37605af3f9120537ed9bbc5d3996] | committer: Diego Biurrun

id3v2: reduce the scope of some non-globally-used symbols/structures

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

 libavformat/id3v2.c |   22 ++++++++++++++--------
 libavformat/id3v2.h |   10 ----------
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 9c715ee..c593007 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -54,7 +54,7 @@ const AVMetadataConv ff_id3v2_4_metadata_conv[] = {
     { 0 }
 };
 
-const AVMetadataConv ff_id3v2_2_metadata_conv[] = {
+static const AVMetadataConv id3v2_2_metadata_conv[] = {
     { "TAL",  "album"},
     { "TCO",  "genre"},
     { "TT2",  "title"},
@@ -380,7 +380,14 @@ finish:
         av_dict_set(m, "date", date, 0);
 }
 
-const ID3v2EMFunc ff_id3v2_extra_meta_funcs[] = {
+typedef struct ID3v2EMFunc {
+    const char *tag3;
+    const char *tag4;
+    void (*read)(AVFormatContext*, AVIOContext*, int, char*, ID3v2ExtraMeta **);
+    void (*free)();
+} ID3v2EMFunc;
+
+static const ID3v2EMFunc id3v2_extra_meta_funcs[] = {
     { "GEO", "GEOB", read_geobtag, free_geobtag },
     { NULL }
 };
@@ -393,13 +400,12 @@ const ID3v2EMFunc ff_id3v2_extra_meta_funcs[] = {
 static const ID3v2EMFunc *get_extra_meta_func(const char *tag, int isv34)
 {
     int i = 0;
-    while (ff_id3v2_extra_meta_funcs[i].tag3) {
+    while (id3v2_extra_meta_funcs[i].tag3) {
         if (!memcmp(tag,
-                    (isv34 ?
-                        ff_id3v2_extra_meta_funcs[i].tag4 :
-                        ff_id3v2_extra_meta_funcs[i].tag3),
+                    (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
+                             id3v2_extra_meta_funcs[i].tag3),
                     (isv34 ? 4 : 3)))
-            return &ff_id3v2_extra_meta_funcs[i];
+            return &id3v2_extra_meta_funcs[i];
         i++;
     }
     return NULL;
@@ -560,7 +566,7 @@ void ff_id3v2_read_all(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **e
         }
     } while (found_header);
     ff_metadata_conv(&s->metadata, NULL, ff_id3v2_34_metadata_conv);
-    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_2_metadata_conv);
+    ff_metadata_conv(&s->metadata, NULL, id3v2_2_metadata_conv);
     ff_metadata_conv(&s->metadata, NULL, ff_id3v2_4_metadata_conv);
     merge_date(&s->metadata);
 }
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h
index 13dec39..4fb738a 100644
--- a/libavformat/id3v2.h
+++ b/libavformat/id3v2.h
@@ -59,13 +59,6 @@ typedef struct ID3v2ExtraMetaGEOB {
     uint8_t *data;
 } ID3v2ExtraMetaGEOB;
 
-typedef struct ID3v2EMFunc {
-    const char *tag3;
-    const char *tag4;
-    void (*read)(AVFormatContext*, AVIOContext*, int, char*, ID3v2ExtraMeta **);
-    void (*free)();
-} ID3v2EMFunc;
-
 /**
  * Detect ID3v2 Header.
  * @param buf   must be ID3v2_HEADER_SIZE byte long
@@ -99,11 +92,8 @@ void ff_id3v2_read_all(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **e
  */
 void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta);
 
-extern const ID3v2EMFunc ff_id3v2_extra_meta_funcs[];
-
 extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
 extern const AVMetadataConv ff_id3v2_4_metadata_conv[];
-extern const AVMetadataConv ff_id3v2_2_metadata_conv[];
 
 /**
  * A list of text information frames allowed in both ID3 v2.3 and v2.4



More information about the ffmpeg-cvslog mailing list