1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-07 22:57:42 +00:00

af: check audio params for validity

Normally, these should be valid anyway, so this is just being cautious.
This commit is contained in:
wm4 2014-11-12 20:03:04 +01:00
parent e9792326e3
commit a669a1d0dd

View File

@ -526,11 +526,16 @@ static int af_reinit(struct af_stream *s)
// Reset just in case...
mp_audio_set_null_data(&in);
if (!mp_audio_config_valid(&in))
goto error;
int rv = af->control(af, AF_CONTROL_REINIT, &in);
if (rv == AF_OK && !mp_audio_config_equals(&in, af->prev->data))
rv = AF_FALSE; // conversion filter needed
switch (rv) {
case AF_OK:
if (!mp_audio_config_valid(af->data))
goto error;
af = af->next;
break;
case AF_FALSE: { // Configuration filter is needed