commands: playback speed: adjust video timing after change
commit213a224eec05cbd86b06abbdd843f2e252658b37
authorUoti Urpala <uau@mplayer2.org>
Mon, 17 Sep 2012 16:01:07 +0000 (17 19:01 +0300)
committerUoti Urpala <uau@mplayer2.org>
Wed, 19 Sep 2012 14:15:59 +0000 (19 17:15 +0300)
treeb6a0da176cacafea30fd62496315bd516926765e
parent6e24a77f3ce2b856c97258ef29b83f7bf7007283
commands: playback speed: adjust video timing after change

When changing playback speed, adjust timing state with the goal of
keeping video playback as smooth as possible. This avoids some
undesirable video jumps and pauses that occurred previously, but makes
some audio issues more apparent.

The most obvious audio issue is that if you reduce playback speed
suddenly, then audio will be missing for a while, especially if audio
output buffers are long. Suppose two seconds of audio are in AO
buffers, and you change speed from 8 to 1. The already buffered audio
contains the audio for the next 2 * 8 = 16 seconds in compressed form.
Thus audio will continue playing at high speed for the next 2 seconds,
and then there will be 14 seconds of silence as the audio
corresponding to that part was already consumed. There is no simple
fix for this: nicer behavior would require keeping a copy of the
original normal-speed audio and then after a speed change re-filtering
it and replacing the existing buffers with the result.
command.c