[FFmpeg-devel] [PATCH] mp3 muxer: write all metadata

Måns Rullgård mans
Thu Oct 1 10:44:02 CEST 2009


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> On Wed, Sep 30, 2009 at 10:10:45PM -0700, Baptiste Coudurier wrote:
>> Hi,
>> 
>> On 9/30/09 12:02 AM, Anton Khirnov wrote:
>>  > [...]
>>  >
>> > diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
>> > index feccaf7..6663c6a 100644
>> > --- a/libavformat/id3v2.c
>> > +++ b/libavformat/id3v2.c
>> > @@ -244,3 +244,22 @@ const AVMetadataConv ff_id3v2_metadata_conv[] = {
>> >       { "TSOT", "titlesort"},
>> >       { 0 }
>> >   };
>> > +
>> > +const char ff_id3v2_tags[][4] = {
>> > +   { 'T', 'A', 'L', 'B'}, { 'T', 'B', 'P', 'M'}, { 'T', 'C', 'O', 'M'},
>> > +   { 'T', 'C', 'O', 'N'}, { 'T', 'C', 'O', 'P'}, { 'T', 'D', 'E', 'N'},
>> > +   { 'T', 'D', 'L', 'Y'}, { 'T', 'D', 'O', 'R'}, { 'T', 'D', 'R', 'C'},
>> > +   { 'T', 'D', 'R', 'L'}, { 'T', 'D', 'T', 'G'}, { 'T', 'E', 'N', 'C'},
>> > +   { 'T', 'E', 'X', 'T'}, { 'T', 'F', 'L', 'T'}, { 'T', 'I', 'P', 'L'},
>> > +   { 'T', 'I', 'T', '1'}, { 'T', 'I', 'T', '2'}, { 'T', 'I', 'T', '3'},
>> > +   { 'T', 'K', 'E', 'Y'}, { 'T', 'L', 'A', 'N'}, { 'T', 'L', 'E', 'N'},
>> > +   { 'T', 'M', 'C', 'L'}, { 'T', 'M', 'E', 'D'}, { 'T', 'M', 'O', 'O'},
>> > +   { 'T', 'O', 'A', 'L'}, { 'T', 'O', 'F', 'N'}, { 'T', 'O', 'L', 'Y'},
>> > +   { 'T', 'O', 'P', 'E'}, { 'T', 'O', 'W', 'N'}, { 'T', 'P', 'E', '1'},
>> > +   { 'T', 'P', 'E', '2'}, { 'T', 'P', 'E', '3'}, { 'T', 'P', 'E', '4'},
>> > +   { 'T', 'P', 'O', 'S'}, { 'T', 'P', 'R', 'O'}, { 'T', 'P', 'U', 'B'},
>> > +   { 'T', 'R', 'C', 'K'}, { 'T', 'R', 'S', 'N'}, { 'T', 'R', 'S', 'O'},
>> > +   { 'T', 'S', 'O', 'A'}, { 'T', 'S', 'O', 'P'}, { 'T', 'S', 'O', 'T'},
>> > +   { 'T', 'S', 'R', 'C'}, { 'T', 'S', 'S', 'E'}, { 'T', 'S', 'S', 'T'},
>> > +   { 0 }
>> 
>> Personally, I find more readable {'T','O','P','E'} without the spaces, 
>> but that's not my call.
>
> Hm, is it possible to use "TOPE", that sure would be even more
> readable...

It will work, although you'll get a warning about excess elements in
initialiser, referring to the null terminator which doesn't fit in the
array.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list