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

Baptiste Coudurier baptiste.coudurier
Fri May 22 00:33:48 CEST 2009


Michael Niedermayer wrote:
> On Sat, May 16, 2009 at 11:48:57PM -0700, Baptiste Coudurier wrote:
>> Hi,
>>
>> On 5/16/2009 8:03 AM, Yuriy Kaminskiy wrote:
>>> Baptiste Coudurier wrote:
>>>>>> -    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 :)
>>> And still are.
>>>> Here is a better patch.
>>> Tiny bit at most.
>> Shame on me.
>>
>>>> -    if (s->is_vcd && only_for_stream_id==AUDIO_ID) {
>>>> +    if (s->is_vcd && only_for_stream_id & 0xc0 == AUDIO_ID) {
>>> (A&B==C) equal to (A&(B==C)); not ((A&B)==C) (as you expected).
>>> I.e. this one is equal to ... && (only_for_stream_id & 1)).
>>> [I personally never try to remember what is relative precedence between
>>>  normal ops vs. bitwise ops, always use parenthesis[*] and you will be
>>> ok, otherwise code would be hard to read and prone to errors]
>>> FWIW, `gcc -Wall` would warn about this code.
>>>
>>> [*] with exception of obvious cases - && vs ||, + vs *, etc;
>>> but with bitwise ops and shift ALWAYS use parenthesis.
>> You are right, thanks for correcting me.
>>
>> Another try.
> 
> looks good assuming its tested

It was, applied.

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



More information about the ffmpeg-devel mailing list