|
|
e44045 |
From 59d264ac56d644f626251daa44ef7b39a9a9fe03 Mon Sep 17 00:00:00 2001
|
|
|
e44045 |
From: Georg Chini <georg@chini.tk>
|
|
|
e44045 |
Date: Sun, 3 Dec 2017 22:29:09 +0100
|
|
|
e44045 |
Subject: [PATCH 84/85] sink, source: Don't finish move if unlink happens after
|
|
|
e44045 |
pa_*_move_all_start()
|
|
|
e44045 |
|
|
|
e44045 |
When a sink input was unlinked between the calls to pa_sink_move_all_start() and
|
|
|
e44045 |
pa_sink_move_all_finish(), pa_sink_move_all_finish() tried to finish the move
|
|
|
e44045 |
of the already unlinked sink input, which lead to an assertion in
|
|
|
e44045 |
pa_sink_input_finish_move(). The same applies for the source side.
|
|
|
e44045 |
|
|
|
e44045 |
This patch fixes the problem by checking the state of the sink input or
|
|
|
e44045 |
source output in pa_*_move_all_finish().
|
|
|
e44045 |
|
|
|
e44045 |
Bug report: https://bugs.freedesktop.org/show_bug.cgi?id=103752
|
|
|
e44045 |
---
|
|
|
e44045 |
src/pulsecore/sink.c | 6 ++++--
|
|
|
e44045 |
src/pulsecore/source.c | 6 ++++--
|
|
|
e44045 |
2 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
e44045 |
|
|
|
e44045 |
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
|
|
|
e44045 |
index 017b9539..39bf18f1 100644
|
|
|
e44045 |
--- a/src/pulsecore/sink.c
|
|
|
e44045 |
+++ b/src/pulsecore/sink.c
|
|
|
e44045 |
@@ -920,9 +920,11 @@ void pa_sink_move_all_finish(pa_sink *s, pa_queue *q, bool save) {
|
|
|
e44045 |
pa_assert(q);
|
|
|
e44045 |
|
|
|
e44045 |
while ((i = PA_SINK_INPUT(pa_queue_pop(q)))) {
|
|
|
e44045 |
- if (pa_sink_input_finish_move(i, s, save) < 0)
|
|
|
e44045 |
- pa_sink_input_fail_move(i);
|
|
|
e44045 |
+ if (PA_SINK_INPUT_IS_LINKED(i->state)) {
|
|
|
e44045 |
+ if (pa_sink_input_finish_move(i, s, save) < 0)
|
|
|
e44045 |
+ pa_sink_input_fail_move(i);
|
|
|
e44045 |
|
|
|
e44045 |
+ }
|
|
|
e44045 |
pa_sink_input_unref(i);
|
|
|
e44045 |
}
|
|
|
e44045 |
|
|
|
e44045 |
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
|
|
|
e44045 |
index d579c357..6099c10d 100644
|
|
|
e44045 |
--- a/src/pulsecore/source.c
|
|
|
e44045 |
+++ b/src/pulsecore/source.c
|
|
|
e44045 |
@@ -860,9 +860,11 @@ void pa_source_move_all_finish(pa_source *s, pa_queue *q, bool save) {
|
|
|
e44045 |
pa_assert(q);
|
|
|
e44045 |
|
|
|
e44045 |
while ((o = PA_SOURCE_OUTPUT(pa_queue_pop(q)))) {
|
|
|
e44045 |
- if (pa_source_output_finish_move(o, s, save) < 0)
|
|
|
e44045 |
- pa_source_output_fail_move(o);
|
|
|
e44045 |
+ if (PA_SOURCE_OUTPUT_IS_LINKED(o->state)) {
|
|
|
e44045 |
+ if (pa_source_output_finish_move(o, s, save) < 0)
|
|
|
e44045 |
+ pa_source_output_fail_move(o);
|
|
|
e44045 |
|
|
|
e44045 |
+ }
|
|
|
e44045 |
pa_source_output_unref(o);
|
|
|
e44045 |
}
|
|
|
e44045 |
|
|
|
e44045 |
--
|
|
|
e44045 |
2.14.3
|
|
|
e44045 |
|