diff options
author | wm4 <wm4@nowhere> | 2015-02-10 22:14:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-10 22:14:26 +0100 |
commit | 2a3d19a9dffc2613d491fc4dcd49e1e239e663c9 (patch) | |
tree | 4c5a12946c6495cd7757796440943cd4cc9e3801 /audio | |
parent | 30f3f9fcda34dc57eca478f8333806e19c839115 (diff) | |
download | mpv-2a3d19a9dffc2613d491fc4dcd49e1e239e663c9.tar.bz2 mpv-2a3d19a9dffc2613d491fc4dcd49e1e239e663c9.tar.xz |
af_scaletempo: drop detaching or skipping init on speed=1
This code skipped initialization if no speed/pitch change was to be
applied.
It also didn't force conversion of the audio to a supported format,
which is probably the most important case in context of compatibility.
With this change applied, af_scaletempo will always force format
conversion.
To make the change less disruptive, make the filter detach if
unconvertable formats are used. Some users use spdif and also have
"af=scaletempo" in their config, so better not completely break this.
In the case the filter was added with the "speed=both" suboption, the
filter also detached itself in this case; but it's an obscure case, so I
don't care about that.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_scaletempo.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c index f48f67fbc3..449ad02dc2 100644 --- a/audio/filter/af_scaletempo.c +++ b/audio/filter/af_scaletempo.c @@ -287,19 +287,17 @@ static int control(struct af_instance *af, int cmd, void *arg) int nch = data->nch; int use_int = 0; + if (AF_FORMAT_IS_SPECIAL(data->format)) { + MP_ERR(af, "Changing speed is not supported with spdif formats.\n"); + return AF_DETACH; + } + MP_VERBOSE(af, "%.3f speed * %.3f scale_nominal = %.3f\n", s->speed, s->scale_nominal, s->scale); mp_audio_force_interleaved_format(data); mp_audio_copy_config(af->data, data); - if (s->scale == 1.0) { - if (s->speed_tempo && s->speed_pitch) - return AF_DETACH; - af->delay = 0; - return af_test_output(af, data); - } - if (data->format == AF_FORMAT_S16) { use_int = 1; } else { |