[FFmpeg-devel] [PATCH] make libavcodec use bytestream functions

Ramiro Ribeiro Polla ramiro
Thu May 10 17:27:07 CEST 2007


Benoit Fouet wrote:
> Ramiro Ribeiro Polla wrote:
>   
>> M?ns Rullg?rd wrote:
>>     
>>> Ramiro Ribeiro Polla wrote:
>>>  
>>>       
>>>> Ramiro Ribeiro Polla wrote:
>>>>    
>>>>         
>>>>> M?ns Rullg?rd wrote:
>>>>>      
>>>>>           
>>>>>> Jindrich Makovicka wrote:
>>>>>>
>>>>>>        
>>>>>>             
>>>>>>> On 5/10/07, Jindrich Makovicka <makovick at gmail.com> wrote:
>>>>>>>
>>>>>>>          
>>>>>>>               
>>>>>>>> On 5/10/07, M?ns Rullg?rd <mans at mansr.com> wrote:
>>>>>>>>
>>>>>>>>            
>>>>>>>>                 
>>>>>>>>> Jindrich Makovicka <makovick at gmail.com> writes:
>>>>>>>>>
>>>>>>>>>              
>>>>>>>>>                   
>>>>>>>>>> intreadwrite.h needs fixing to compile here.
>>>>>>>>>>
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>> OK.
>>>>>>>>>
>>>>>>>>> Out of interest, what compiler are you using, and what is the
>>>>>>>>> error
>>>>>>>>> message?
>>>>>>>>>
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>> i am away from the machine now, but it's gcc from Debian Sid
>>>>>>>> (probably
>>>>>>>> 4.1.2) complaining about the semicolon after the closing brace.
>>>>>>>>
>>>>>>>>             
>>>>>>>>                 
>>>>>>> more precisely, it complained about this piece of code:
>>>>>>>
>>>>>>>         if (le) AV_WL16(*dst, v);
>>>>>>>         else    AV_WB16(*dst, v);
>>>>>>>
>>>>>>>           
>>>>>>>               
>>>>>> Ah, that explains it.  That bit is invalid C with the braces as they
>>>>>> are now.
>>>>>> Where is that code?
>>>>>>         
>>>>>>             
>>>>> Should I fix this in pcm.c with attached patch or intreadwrite.h?
>>>>>
>>>>>       
>>>>>           
>>>> Fixed in pcm.c, since it seems more correct.
>>>>     
>>>>         
>>> It was not correct.  The header is still broken, and anything that looks
>>> like valid code should remain that way after macro expansion.
>>>
>>>  
>>>       
>>>> The ST macros aren't enclosed in {}s, so that's why it compiled fine
>>>> for
>>>> me. When more than one byte is written to in intreadwrite.h, {}s are
>>>> used, so the ; after them screwed up the if statement.
>>>>
>>>> Attached patch prevents this error from being silently ignored
>>>> again. It
>>>> makes all AV_W macros look the same as {}s are concerned.
>>>>     
>>>>         
>>> No, very much no.  Your first patch was good.  Apply it.
>>>
>>>   
>>>       
>> Do you prefer this patch? It looked uglier to me, so that's why I
>> preferred fixing pcm.c.
>> But with your explanation, it sounds saner.
>>
>> After intreadwrite.h gets fixed, should I revert the temporary fix I
>> made on pcm.c (which wasn't the best solution)?
>>
>>     
>
> i think M?ns was talking about Jindrich fix, no ?
> with the do{...}while(0) stuff
>
>   
Hmm... I hadn't seen the patch attached on his e-mail. It's better.
I'll have to eat now, and wait for the proper oks:

1. apply Jindrich's patch?
2. revert my quick fix?

Ramiro Polla




More information about the ffmpeg-devel mailing list