af: don't attempt to remove last filter for spdif filter removal

Some time ago, a mechanism was added for automatically removing PCM-only
filters if the input format is spdif.

This could cause an infinite loop if the AO did not support spdif, but
was falling back to some PCM format. Then this code tried to remove the
last filter, which is a dummy filter for receiving and queuing filter
output. af_remove() simply fails gracefully in this case, so this
happens over and over again.

Fix by explicitly checking whether the filter to remove is a dummy
filter. (af_remove() also fails only if the dummy filters are attempted
to be removed - checking this directly is simpler.)
This commit is contained in:
wm4 2015-05-05 21:47:48 +02:00
parent d76f9a484e
commit 0025030cef
1 changed files with 1 additions and 1 deletions

View File

@ -577,7 +577,7 @@ static int af_reinit(struct af_stream *s)
if (af_fmt_is_valid(fmt_in1) && af_fmt_is_valid(fmt_in2)) { if (af_fmt_is_valid(fmt_in1) && af_fmt_is_valid(fmt_in2)) {
bool spd1 = AF_FORMAT_IS_IEC61937(fmt_in1); bool spd1 = AF_FORMAT_IS_IEC61937(fmt_in1);
bool spd2 = AF_FORMAT_IS_IEC61937(fmt_in2); bool spd2 = AF_FORMAT_IS_IEC61937(fmt_in2);
if (spd1 != spd2) { if (spd1 != spd2 && af->next) {
MP_WARN(af, "Filter %s apparently cannot be used due to " MP_WARN(af, "Filter %s apparently cannot be used due to "
"spdif passthrough - removing it.\n", "spdif passthrough - removing it.\n",
af->info->name); af->info->name);