summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-05 21:47:48 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-05-07 10:51:30 +0900
commit625fb59d08a49f13aa786243ddb1550247d43d0f (patch)
tree5beb80aca2ed5946eba857d0b0f5563d284eb41d
parent71a88d75ffb9112f63899e2ed218c5c0d50adf72 (diff)
downloadmpv-625fb59d08a49f13aa786243ddb1550247d43d0f.tar.bz2
mpv-625fb59d08a49f13aa786243ddb1550247d43d0f.tar.xz
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.) (cherry picked from commit 0025030cef757327769982333f9105aa510c393d)
-rw-r--r--audio/filter/af.c2
1 files changed, 1 insertions, 1 deletions
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);