summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-02-04 20:00:32 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-05 02:47:14 -0800
commit2f6dc93276d3feb7f9096baab18045502f20c11b (patch)
tree21817123cf909517097b38908007dd19d33cf7a1
parentbeb8d27912cb8d831962ac386b26d7b02929307d (diff)
downloadmpv-2f6dc93276d3feb7f9096baab18045502f20c11b.tar.bz2
mpv-2f6dc93276d3feb7f9096baab18045502f20c11b.tar.xz
filter: don't randomly lose async wakeup notifications
Another "what was I thinking" thing - destroying filters explicitly skipped async wakeups for no reason. These were notifications for filters that are not going to be destroyed too, and so their wakeup will be lost, leading to stalled playback. This is completely unnecessary and the special code can be removed. Fixes #5488. (This case destroyed all audio filters due to AO init failure, which could make clear out the f_demux_in.c wakeup for video, and "freeze" playback.)
-rw-r--r--filters/filter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/filters/filter.c b/filters/filter.c
index 60e9bc265e..c6c2603156 100644
--- a/filters/filter.c
+++ b/filters/filter.c
@@ -165,13 +165,12 @@ void mp_filter_internal_mark_progress(struct mp_filter *f)
// Basically copy the async notifications to the sync ones. Done so that the
// sync notifications don't need any locking.
-static void flush_async_notifications(struct filter_runner *r, bool queue)
+static void flush_async_notifications(struct filter_runner *r)
{
pthread_mutex_lock(&r->async_lock);
for (int n = 0; n < r->num_async_pending; n++) {
struct mp_filter *f = r->async_pending[n];
- if (queue)
- add_pending(f);
+ add_pending(f);
f->in->async_pending = false;
}
r->num_async_pending = 0;
@@ -185,7 +184,7 @@ bool mp_filter_run(struct mp_filter *filter)
r->filtering = true;
- flush_async_notifications(r, true);
+ flush_async_notifications(r);
while (r->num_pending) {
struct mp_filter *next = r->pending[r->num_pending - 1];
@@ -653,7 +652,7 @@ static void filter_destructor(void *p)
// Just make sure the filter is not still in the async notifications set.
// There will be no more new notifications at this point (due to destroy()).
- flush_async_notifications(r, false);
+ flush_async_notifications(r);
for (int n = 0; n < r->num_pending; n++) {
if (r->pending[n] == f) {