[MPlayer-dev-eng] [Patch] Cropdetect Aspect Ratio display & True Speed

Alexander Roalter alex at roalter.it
Thu May 14 12:44:13 CEST 2009


Reimar Döffinger wrote:
> On Thu, May 14, 2009 at 09:18:23AM +0200, Alexander Roalter wrote:
>> +if ((speed24 == 1) && (((int)(1.0/mpctx->sh_video->frametime)) == 25))
> 
> That be written a bit simpler (less () in particular), also comparing
> the frame rate against 25 without rounding seems a bit questionable -
> any rounding error and it won't work.
> 
>> +    playback_speed = 0.96;
>> +    mpctx->sh_video->frametime = (1.0/24.0);
> 
> Huh? Why both? setiing playback_speed should already fix up the frame
> rate.
> 
>> Index: cfg-mplayer.h
>> ===================================================================
>> --- cfg-mplayer.h	(revision 29308)
>> +++ cfg-mplayer.h	(working copy)
>> @@ -162,6 +162,9 @@
>>  #endif
>>  #endif
>>  
>> +	// force speed on PAL source to 24fps (0.96%)
>> +        {"speed24", &speed24, CONF_TYPE_FLAG, 0, 0, 1, NULL},
>> +
>>  	// force window width/height or resolution (with -vm)
>>  	{"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
> 
> Other options use tabs.
> Now the main problem I have with that:
> on a file-by-file basis -speed 24/25 works just fine (if not that's a
> bug I think).
> For autodetection, the code you have is simply horribly unreliable:
> if a single frame has a duration of 1/25 s it will enable this feature
> and it won't disable it again.
> If the frame rate is slightly off from 1/25 s it possibly will fail to
> enable it. If you avoid that, it might get enabled for files where it
> should not be.

Hm, any chance another detection for just PAL material? The simplest I
came around was the frame rate, and -- in contrast to NTSC, where both
23.97something and 29.9whatever can be found, PAL material always has
25fps by definition.

The simpliest I'd like to have would be

+if (speed24 && mpctx->sh_video->isPAL) playback_speed = 0.96;

and no extra worries... but finding out if it is PAL is another thing,
though there are some constraints: PAL always has a height of 576 lines
(IIRC) and a width of either 704 or 720 pixels. Dunno about the smaller
ones (544, 480, 352 pixel width...)

-- 
cheers,
Alex



More information about the MPlayer-dev-eng mailing list