From 89db92398e1d80acf6566ec3c9e6a0842101fba3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 7 Mar 2015 20:34:05 +0100 Subject: 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). --- audio/filter/af_scaletempo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/filter') diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c index a4f055bee9..1f187a98bc 100644 --- a/audio/filter/af_scaletempo.c +++ b/audio/filter/af_scaletempo.c @@ -305,7 +305,7 @@ static int control(struct af_instance *af, int cmd, void *arg) if (AF_FORMAT_IS_SPECIAL(data->format)) { MP_ERR(af, "Changing speed is not supported with spdif formats.\n"); - return AF_DETACH; + return AF_ERROR; } mp_audio_force_interleaved_format(data); -- cgit v1.2.3