summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-28 14:22:16 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-08-28 18:10:32 +0200
commit0f1d6c09e075dab737b78cca06015d8821550cd3 (patch)
tree040e41523928ebd037db0a824ea8c6167f3d7665
parentb677937c27adb15eda58297961638f7df00c1999 (diff)
downloadmpv-0f1d6c09e075dab737b78cca06015d8821550cd3.tar.bz2
mpv-0f1d6c09e075dab737b78cca06015d8821550cd3.tar.xz
audio: restore old speed change behavior
Don't attempt to resync after speed changes. Note that most other cases of audio reinit (like switching tracks etc.) still resync, but other code paths take care of setting the audio_status accordingly. This restores the old behavior of not trying to fix audio desync, which was probably changed with commit 261506e3. Note that the code as of now wasn't even entirely correct, since the A/V sync values are slightly shifted. The dsync depends on the audio buffer size, so a larger buffer size will show more extreme desync. Also see mplayer2 commit 213a224e, which should fixed this - it was not merged into mpv, because it disabled audio for too long, resulting in a worse user experience. This is similar to the issue this commit attempts to fix. Fixes: #1042 (probably) CC: @mpv-player-stable
-rw-r--r--player/audio.c2
-rw-r--r--player/command.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/player/audio.c b/player/audio.c
index 55e3ba7c5e..29fe4b3eaa 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -111,8 +111,6 @@ void reinit_audio_chain(struct MPContext *mpctx)
mp_notify(mpctx, MPV_EVENT_AUDIO_RECONFIG, NULL);
- mpctx->audio_status = STATUS_SYNCING;
-
if (!(mpctx->initialized_flags & INITIALIZED_ACODEC)) {
mpctx->initialized_flags |= INITIALIZED_ACODEC;
assert(!mpctx->d_audio);
diff --git a/player/command.c b/player/command.c
index c0800d612d..92d9a70a25 100644
--- a/player/command.c
+++ b/player/command.c
@@ -166,6 +166,8 @@ static int mp_property_playback_speed(void *ctx, struct m_property *prop,
switch (action) {
case M_PROPERTY_SET: {
opts->playback_speed = *(double *) arg;
+ if (opts->playback_speed == orig_speed)
+ return M_PROPERTY_OK;
// Adjust time until next frame flip for nosound mode
mpctx->time_frame *= orig_speed / opts->playback_speed;
if (mpctx->d_audio)