[FFmpeg-devel] [PATCH] MPEG PS consider other audio tracks when muxing

Måns Rullgård mans
Sat May 16 04:06:38 CEST 2009


Michael Niedermayer <michaelni at gmx.at> writes:

> On Fri, May 15, 2009 at 12:18:26PM -0700, Baptiste Coudurier wrote:
>> Hi Michael,
>> 
>> On 5/15/2009 11:55 AM, Michael Niedermayer wrote:
>> > On Fri, May 15, 2009 at 10:38:56AM -0700, Baptiste Coudurier wrote:
>> >> Hi
>> >>
>> >> $subject, this patch fixes a bug when muxing more than one audio track.
>> >> id of other audio tracks will be > 0xc000 in this case.
>> >>
>> >> -- 
>> >> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
>> >> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
>> >> FFmpeg maintainer                                  http://www.ffmpeg.org
>> > 
>> >>  mpegenc.c |   10 +++++-----
>> >>  1 file changed, 5 insertions(+), 5 deletions(-)
>> >> 281a89d8f0423e904687d78298fbc2a2f6dd21be  ps_audio.patch
>> >> Index: libavformat/mpegenc.c
>> >> ===================================================================
>> >> --- libavformat/mpegenc.c	(revision 18820)
>> >> +++ libavformat/mpegenc.c	(working copy)
>> >> @@ -157,7 +157,7 @@
>> >>  
>> >>      put_bits(&pb, 1, 1); /* marker */
>> >>  
>> >> -    if (s->is_vcd && only_for_stream_id==AUDIO_ID) {
>> >> +    if (s->is_vcd && only_for_stream_id & 0xc000 == 0xc000) {
>> > 
>> > AUDIO_ID is 0xc0 not 0xc000
>> 
>> I must have been high :)
>> 
>> Here is a better patch.
>> 
>>  mpegenc.c |   10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>> bb618f5e0439cdb7a5a971d47a93b74435db5e46  ps_audio2.patch
>> Index: libavformat/mpegenc.c
>> ===================================================================
>> --- libavformat/mpegenc.c	(revision 18820)
>> +++ libavformat/mpegenc.c	(working copy)
>> @@ -157,7 +157,7 @@
>>  
>>      put_bits(&pb, 1, 1); /* marker */
>>  
>> -    if (s->is_vcd && only_for_stream_id==AUDIO_ID) {
>> +    if (s->is_vcd && only_for_stream_id & 0xc0 == AUDIO_ID) {
>
> x & 0xc0 == 0xc0 is also true for video streams i think

The correct test for audio is x&0xe0 == 0xc0.  The test for video is
x&0xf0 == 0xe0.

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



More information about the ffmpeg-devel mailing list