[FFmpeg-devel] [PATCH] mpeg: fix dvdaudio with multiple private streams

Baptiste Coudurier baptiste.coudurier at gmail.com
Wed Aug 31 20:09:16 CEST 2011


On 08/31/2011 03:40 AM, Petri Hintukainen wrote:
> Baptiste Coudurier wrote:
>> ---
>>   libavformat/mpeg.c |   10 +++++++---
>>   1 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
>> index 364473a..e6e5cfb 100644
>> --- a/libavformat/mpeg.c
>> +++ b/libavformat/mpeg.c
>> @@ -425,14 +425,16 @@ static int mpegps_read_packet(AVFormatContext *s,
>>       enum AVMediaType type;
>>       int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
>>       uint8_t av_uninit(dvdaudio_substream_type);
>> +    int sub_id;
>>
>>    redo:
>>       len = mpegps_read_pes_header(s,&dummy_pos,&startcode,&pts,&dts);
>>       if (len<  0)
>>           return len;
>>
>> +    sub_id = startcode;
>>       if(startcode == 0x1bd) {
>> -        dvdaudio_substream_type = get_byte(s->pb);
>> +        sub_id = dvdaudio_substream_type = get_byte(s->pb);
>>           url_fskip(s->pb, 3);
>>           len -= 4;
>>       }
>> @@ -440,7 +442,7 @@ static int mpegps_read_packet(AVFormatContext *s,
>>       /* now find stream */
>>       for(i=0;i<s->nb_streams;i++) {
>>           st = s->streams[i];
>> -        if (st->id == startcode)
>> +        if (st->id == sub_id)
>>               goto found;
>>       }
>>
>> @@ -515,6 +517,8 @@ static int mpegps_read_packet(AVFormatContext *s,
>>           switch(dvdaudio_substream_type&  0xe0) {
>>           case 0xa0:  codec_id = CODEC_ID_PCM_DVD;
>>                       break;
>> +        case 0xa1:  codec_id = CODEC_ID_PCM_DVD;
>> +                    break;
>>           case 0x80:  if((dvdaudio_substream_type&  0xf8) == 0x88)
>>                            codec_id = CODEC_ID_DTS;
>>                       else codec_id = CODEC_ID_AC3;
>
> This seems redundant: case 0xa1 is unreachable (5 lowest bits are
> already cleared in switch()) ?

Right, this hunk is useless.

-- 
Baptiste COUDURIER
Key fingerprint          8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                           http://www.ffmpeg.org


More information about the ffmpeg-devel mailing list