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

Baptiste Coudurier baptiste.coudurier at gmail.com
Wed Aug 31 20:13:24 CEST 2011


On 08/30/2011 12:45 PM, Michael Niedermayer wrote:
> On Mon, Aug 29, 2011 at 11:35:22AM -0700, 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;
>>       }
>
> cant the dvdaudio_substream_type collide with startcode ?

Humm, I guess it could.
I guess we could use startcode << 8 | dvd_audio_stream_type.
Ok with that ?

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


More information about the ffmpeg-devel mailing list