[MPlayer-dev-eng] [PATCH] dvdnav part 2 - still frames

Nico Sabbi nsabbi at email.it
Sun Jul 29 19:58:37 CEST 2007


Reimar Döffinger wrote:

>Hello,
>On Sun, Jul 29, 2007 at 12:07:21AM +0200, ?tv?s Attila wrote:
>  
>
>>+//
>>+// convert dvd time to millisec
>>+//
>>+static int dvdtimetomsec(dvd_time_t *dt)
>>+{
>>+  static int framerates[4] = {0, 2500, 0, 2997};
>>+  int framerate = framerates[(dt->frame_u & 0xc0) >> 6];
>>+  int msec = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600000;
>>    
>>
>
>This is awfully obfuscated, and for no good reason. >> 3 * 5 is actually
>most likely slower than >> 4 * 10, and the later means that
>1) the & 0xf0 is not needed.
>2) it is obvious that this is just bcd.
>
>And actually IMO you should factor that out into a
>  
>


btw, an identical function is already in stream_dvd.c, so just export it





More information about the MPlayer-dev-eng mailing list