Make ff_mkv_codec_tags lie entirely in .rodata section.
authorAurelien Jacobs <aurel@gnuage.org>
Mon, 7 Jan 2008 00:03:19 +0000 (00:03 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Mon, 7 Jan 2008 00:03:19 +0000 (00:03 +0000)
From: Diego 'Flameeyes' Pettenò < flameeyes _at_ gmail _dot_ com >

Originally committed as revision 11440 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroska.c
libavformat/matroska.h
libavformat/matroskadec.c

index 9b0cc06dcfe568ca81a53f58f002d90a0cb9a454..382534e9bd91c18769450ad3104462b31c8c765b 100644 (file)
@@ -68,6 +68,6 @@ const CodecTags ff_mkv_codec_tags[]={
     {"S_SSA"            , CODEC_ID_SSA},
     {"S_VOBSUB"         , CODEC_ID_DVD_SUBTITLE},
 
-    {NULL               , CODEC_ID_NONE}
+    {""                 , CODEC_ID_NONE}
 /* TODO: AC3-9/10 (?), Real, Musepack, Quicktime */
 };
index b8d39bbcee5939189206bbe05cad98f44209924d..43fbb9e9c54b8d71e67c79ad5bc8e21371c9a2ae 100644 (file)
@@ -181,7 +181,7 @@ typedef enum {
  */
 
 typedef struct CodecTags{
-    const char *str;
+    char str[16];
     enum CodecID id;
 }CodecTags;
 
index ccf636b5972497eb4f659a043670bfc85886ea94..cc45e9599cb450f0f35ef9650acf81d2785ca12f 100644 (file)
@@ -2048,7 +2048,7 @@ matroska_read_header (AVFormatContext    *s,
             if (track->codec_id == NULL)
                 continue;
 
-            for(j=0; ff_mkv_codec_tags[j].str; j++){
+            for(j=0; ff_mkv_codec_tags[j].id != CODEC_ID_NONE; j++){
                 if(!strncmp(ff_mkv_codec_tags[j].str, track->codec_id,
                             strlen(ff_mkv_codec_tags[j].str))){
                     codec_id= ff_mkv_codec_tags[j].id;