summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-07 20:34:05 +0100
committerwm4 <wm4@nowhere>2015-03-07 20:34:05 +0100
commit89db92398e1d80acf6566ec3c9e6a0842101fba3 (patch)
treedc212a8dcdbfa9ffd61da62bd2246754f7fe00c9 /player
parentb2099f55d2595259f5a0d1e6f2bee2f294556e31 (diff)
downloadmpv-89db92398e1d80acf6566ec3c9e6a0842101fba3.tar.bz2
mpv-89db92398e1d80acf6566ec3c9e6a0842101fba3.tar.xz
audio: refuse to change playback speed with spdif
Handle the failure gracefully, instead of exploding and disabling audio. Just set the speed back to 1.0. Also remove the AF_DETACH from af_scaletempo. This actually created a dangling pointer in af_add(), a tricky consequence of af_add() reconfiguring the filter chain and the newly added filter using AF_DETACH. Fortunately the AF_DETACH is not needed (and probably never worked - it comes from MPlayer times, and MPlayer also disables audio when trying to change speed with spdif).
Diffstat (limited to 'player')
-rw-r--r--player/audio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/player/audio.c b/player/audio.c
index f1dfe66784..306df086ab 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -104,8 +104,10 @@ static int recreate_audio_filters(struct MPContext *mpctx)
{
assert(mpctx->d_audio);
- if (update_playback_speed_filters(mpctx) < 0)
- return -1;
+ if (update_playback_speed_filters(mpctx) < 0) {
+ mpctx->opts->playback_speed = 1.0;
+ mp_notify(mpctx, MP_EVENT_CHANGE_ALL, NULL);
+ }
struct af_stream *afs = mpctx->d_audio->afilter;
if (afs->initialized < 1 && af_init(afs) < 0) {