[MPlayer-dev-eng] [PATCH] syncing dvdread - part1

Nico Sabbi nicola_sabbi at fastwebnet.it
Tue Aug 7 00:05:33 CEST 2007


Reimar Döffinger wrote:
> Hello,
> On Mon, Aug 06, 2007 at 11:19:47PM +0200, Nico Sabbi wrote:
> 
>> Attached patch adds the implementation of getbits() used in dvdread from 
>> dvdnav, necessary to get navigation parsing working.
>> The code will be used by a forthcoming patch.
>> If no one objects I'll commit it tomorrow
> 
> 
> Well, if this is only a sync it may not make sense, but...
> 
> 
>>+  if ((state == NULL) || (start == NULL)) return 0;
> 
> 
>>+  if ((state->bit_position) > 0) {  /* Last getbits left us in the middle of a byte. */
> 
> 
>>+      byte = byte >> (state->bit_position);
> 
> 
>>+  if ((state->bit_position) == 0) {
> 
> 
> There are really lots of useless () (and I almost always prefer !ptr
> over ptr == NULL and at least sometimes !var over var == 0).
> 
> Greetings,
> Reimar Döffinger

optimizations are always welcome, but I'd reserved them for the future




More information about the MPlayer-dev-eng mailing list