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

Baptiste Coudurier baptiste.coudurier
Sat May 16 04:40:33 CEST 2009


On Sat, May 16, 2009 at 03:06:38AM +0100, M?ns Rullg?rd wrote:
> 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.

Ouch, thanks guys for being awake.

New patch attached.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA    
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ps_multi_audio.patch
Type: text/x-diff
Size: 1735 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090515/a7248d14/attachment.patch>



More information about the ffmpeg-devel mailing list