diff options
author | wm4 <wm4@nowhere> | 2013-05-12 21:47:55 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-12 21:47:55 +0200 |
commit | e6e5a7b221ef2fcdd5a1982d6fdcb627100447d2 (patch) | |
tree | 08b54ef9bb771434fc7fbe9185793503d3ba314c /audio/filter/af_scaletempo.c | |
parent | 6a83ef1552de4a1a71da49e45647ce1a4ce64e53 (diff) | |
parent | 48f94311516dc1426644b3e68b2a48c22727e1e7 (diff) | |
download | mpv-e6e5a7b221ef2fcdd5a1982d6fdcb627100447d2.tar.bz2 mpv-e6e5a7b221ef2fcdd5a1982d6fdcb627100447d2.tar.xz |
Merge branch 'audio_changes'
Conflicts:
audio/out/ao_lavc.c
Diffstat (limited to 'audio/filter/af_scaletempo.c')
-rw-r--r-- | audio/filter/af_scaletempo.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c index cf326fedfb..5cf0f3b082 100644 --- a/audio/filter/af_scaletempo.c +++ b/audio/filter/af_scaletempo.c @@ -302,26 +302,22 @@ static int control(struct af_instance* af, int cmd, void* arg) "[scaletempo] %.3f speed * %.3f scale_nominal = %.3f\n", s->speed, s->scale_nominal, s->scale); + mp_audio_copy_config(af->data, data); + if (s->scale == 1.0) { if (s->speed_tempo && s->speed_pitch) return AF_DETACH; - memcpy(af->data, data, sizeof(struct mp_audio)); af->delay = 0; af->mul = 1; return af_test_output(af, data); } - af->data->rate = data->rate; - af->data->nch = data->nch; - if ( data->format == AF_FORMAT_S16_LE - || data->format == AF_FORMAT_S16_BE ) { + if (data->format == AF_FORMAT_S16_NE) { use_int = 1; - af->data->format = AF_FORMAT_S16_NE; - af->data->bps = bps = 2; } else { - af->data->format = AF_FORMAT_FLOAT_NE; - af->data->bps = bps = 4; + mp_audio_set_format(af->data, AF_FORMAT_FLOAT_NE); } + bps = af->data->bps; frames_stride = srate * s->ms_stride; s->bytes_stride = frames_stride * bps * nch; |