[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] sink-input, source-output: Fix stream rescue if a move fails

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Thu Jan 16 14:56:21 UTC 2020



Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio


Commits:
fe436f90 by Georg Chini at 2020-01-16T16:50:03+02:00
sink-input, source-output: Fix stream rescue if a move fails

Merge Requests [1] and [2] introduced a regression. Streams were no longer moved
to the default sink or source if a started move failed. This patch fixes the problem.

[1] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/209
[2] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/215

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/794

- - - - -


2 changed files:

- src/pulsecore/sink-input.c
- src/pulsecore/source-output.c


Changes:

=====================================
src/pulsecore/sink-input.c
=====================================
@@ -1979,6 +1979,12 @@ void pa_sink_input_fail_move(pa_sink_input *i) {
     if (pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_FAIL], i) == PA_HOOK_STOP)
         return;
 
+    /* Can we move the sink input to the default sink? */
+    if (pa_sink_input_may_move_to(i, i->core->default_sink)) {
+        if (pa_sink_input_finish_move(i, i->core->default_sink, false) >= 0)
+            return;
+    }
+
     if (i->moving)
         i->moving(i, NULL);
 


=====================================
src/pulsecore/source-output.c
=====================================
@@ -1606,6 +1606,12 @@ void pa_source_output_fail_move(pa_source_output *o) {
     if (pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_MOVE_FAIL], o) == PA_HOOK_STOP)
         return;
 
+    /* Can we move the source output to the default source? */
+    if (pa_source_output_may_move_to(o, o->core->default_source)) {
+        if (pa_source_output_finish_move(o, o->core->default_source, false) >= 0)
+            return;
+    }
+
     if (o->moving)
         o->moving(o, NULL);
 



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/fe436f90998509d2c8e265bce0de4579408e9e3f

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/fe436f90998509d2c8e265bce0de4579408e9e3f
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20200116/90cf98ac/attachment-0001.htm>


More information about the pulseaudio-commits mailing list