af_lavrresample: allow resetting output sample format

It must be allowed to set format==0.
This commit is contained in:
wm4 2015-04-12 18:04:04 +02:00
parent e466a735a3
commit f8a98fc133
1 changed files with 3 additions and 2 deletions

View File

@ -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: {