[MPlayer-dev-eng] Bug in setting playback speed?
Tim Wojtulewicz
timwoj at ieee.org
Sat Sep 23 01:32:18 CEST 2006
I noticed this today when I accidentally hit right bracket to
increase volume instead of 9. If you increase the speed twice, it
goes to 4.0x. If you do it again, it goes to 4.35x. After that
point, the speeds are no longer multiples of 2, and hitting left
bracket won't ever get you back to a perfect 1x again. The closest
it will get is 1.09x.
The problem as far as I can tell is in mplayer.c in build_afilter_chain:
new_srate = sh_audio->samplerate * playback_speed;
if (new_srate != ao_data->samplerate) {
// limits are taken from libaf/af_resample.c
if (new_srate < 8000)
new_srate = 8000;
if (new_srate > 192000)
new_srate = 192000;
playback_speed = (float)new_srate / (float)sh_audio->samplerate;
}
That may cause it to be set to something that isn't a multiple of
two. Maybe it should limit the playback_speed if it increases to a
point where it's no longer a multiple of two? I've seen a couple of
movies that I could get up to 8x, so I know it can go higher than 4
based on the bit rate of the audio. Something like the attached
seems to work ok.
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speed-fix.patch
Type: application/octet-stream
Size: 652 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060922/49735b8a/attachment.obj>
More information about the MPlayer-dev-eng
mailing list