[FFmpeg-devel] [PATCH] Cleaner parity checking code in mlp_parser.c

Ramiro Polla ramiro
Wed Jun 25 14:13:06 CEST 2008


Michael Niedermayer wrote:
> On Wed, Jun 25, 2008 at 12:45:26AM +0100, Ramiro Polla wrote:
>> Michael Niedermayer wrote:
>>> On Tue, Jun 24, 2008 at 08:48:08PM +0100, Ramiro Polla wrote:
>>>> Hello,
>>>>
>>>> In http://article.gmane.org/gmane.comp.video.ffmpeg.devel/59805 Michael 
>>>> suggested a way to minimize the code that does parity checking on 
>>>> mlp_parser.c. This leads to the code being harder to understand.
>>>>
>>>> The for() loop deals with the substream headers, and the smaller code 
>>>> parity checked the access unit header in the same loop. It is confusing 
>>>> since it looks like the loop is only doing the parity check on the 
>>>> substream headers, and not on the access unit header. It takes closer 
>>>> inspection to see that the access unit header is also being checked.
>>>>
>>>> Is attached patch ok to desimplify the code to make it easier to 
>>>> understand?
>>> iam slightly against the patch
>> Then what about your original idea on that thread? A -1 in there already 
>> helps a bit in understanding the code is not only dealing with substream 
>> headers.
> 
> Well i better ok this bikeshed or you will waste more time on it.

If I wasted some time just to understand the code and I found it not 
obvious, I find it a good idea to make it cleaner or at least comment on 
it. Maybe now someone else won't have to spend as much time as I did to 
understand it.

> so, patch ok

Applied.




More information about the ffmpeg-devel mailing list