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

Michael Niedermayer michaelni at gmx.at
Wed Aug 31 20:22:08 CEST 2011


On Wed, Aug 31, 2011 at 11:13:24AM -0700, Baptiste Coudurier wrote:
> 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 ?

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110831/90a80289/attachment.asc>


More information about the ffmpeg-devel mailing list