From 0025030cef757327769982333f9105aa510c393d Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 5 May 2015 21:47:48 +0200 Subject: [PATCH] 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.) --- audio/filter/af.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/filter/af.c b/audio/filter/af.c index 7a6aef0959..21cf866ca3 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -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)) { bool spd1 = AF_FORMAT_IS_IEC61937(fmt_in1); 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 " "spdif passthrough - removing it.\n", af->info->name);