summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-05 21:47:48 +0200
committerwm4 <wm4@nowhere>2015-05-05 21:47:48 +0200
commit0025030cef757327769982333f9105aa510c393d (patch)
treecc49327cabebd6e8234e83a315736c667b90fca0 /audio/filter
parentd76f9a484ea7795655637eb0ddc8655aa4fff345 (diff)
downloadmpv-0025030cef757327769982333f9105aa510c393d.tar.bz2
mpv-0025030cef757327769982333f9105aa510c393d.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.)
Diffstat (limited to 'audio/filter')
-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);