diff options
author | wm4 <wm4@nowhere> | 2015-04-12 18:04:04 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-12 18:07:05 +0200 |
commit | f8a98fc133db0d12db4688704596a679ded0ec2f (patch) | |
tree | 14a27b2c87d4d1d63be36209803e5431758f396f /audio | |
parent | e466a735a39203f81d31d61acc4bfddcb6fb4695 (diff) | |
download | mpv-f8a98fc133db0d12db4688704596a679ded0ec2f.tar.bz2 mpv-f8a98fc133db0d12db4688704596a679ded0ec2f.tar.xz |
af_lavrresample: allow resetting output sample format
It must be allowed to set format==0.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_lavrresample.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index 9e4a8adaaa..679e9f9e8d 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -298,10 +298,11 @@ static int control(struct af_instance *af, int cmd, void *arg) return r; } case AF_CONTROL_SET_FORMAT: { - if (af_to_avformat(*(int*)arg) == AV_SAMPLE_FMT_NONE) + int format = *(int *)arg; + if (format && af_to_avformat(format) == AV_SAMPLE_FMT_NONE) return AF_FALSE; - mp_audio_set_format(af->data, *(int*)arg); + mp_audio_set_format(af->data, format); return AF_OK; } case AF_CONTROL_SET_CHANNELS: { |