[FFmpeg-devel] [PATCH] ffmpeg doesn't decode track number on some wma files

Benoit Fouet benoit.fouet
Thu Jun 14 10:00:49 CEST 2007


Patrice Bensoussan wrote:
> Hello,
>
> On 14 Jun 2007, at 08:40, Benoit Fouet wrote:
>
>   
>> Hi,
>>
>> Patrice Bensoussan wrote:
>>     
>>> Index: libavformat/asf.c
>>> ===================================================================
>>> --- libavformat/asf.c	(revision 9304)
>>> +++ libavformat/asf.c	(working copy)
>>> @@ -389,6 +389,16 @@
>>>                          {
>>>                                  if     (!strcmp(name,"WM/ 
>>> AlbumTitle")) get_str16_nolen(pb, value_len, s->album, sizeof(s- 
>>>       
>>>> album));
>>>>         
>>>                                  else if(!strcmp(name,"WM/ 
>>> Genre"     )) get_str16_nolen(pb, value_len, s->genre, sizeof(s- 
>>>       
>>>> genre));
>>>>         
>>> +                                else if (!strcmp(name,"WM/Track")) {
>>> +                                    char track[8];
>>> +                                    get_str16_nolen(pb,  
>>> value_len, track, sizeof(track));
>>> +                                    s->track = strtol(track,  
>>> NULL, 10) + 1;
>>> +                                }
>>> +                                else if (!strcmp(name,"WM/ 
>>> TrackNumber")) {
>>> +                                    char track[8];
>>> +                                    get_str16_nolen(pb,  
>>> value_len, track, sizeof(track));
>>> +                                    s->track = strtol(track,  
>>> NULL, 10);
>>> +                                }
>>>
>>>       
>> you should try to keep the nice alignment
>> also, if i read correctly, it is the very same code for the two  
>> else if
>> you added. Why not add them into a single one ?
>>     
>
> The alignment seems to be correct for me (I checked with an hex  
> editor and can only see spaces unless I am missing something).

i was more thinking of if and strcmp's parenthesis alignment

>  I  
> didn't add them into a single one because the code is different. WM/ 
> Track is zero based, WM/TrackNumber is not). This means I would have  
> to test twice WM/Track to know when to add 1 which is kind of ugly  
> too...
>
>   

i hadn't seen it, sorry...

Ben
-- 
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list