build_pollfd() isn't likely to fail, but if it does, pa_sink/source_put()
will crash on an assertion failure. I haven't seen such crash happening,
this is just something that I noticed while studying the state change
code.
---
 src/modules/alsa/alsa-sink.c   | 3 +++
 src/modules/alsa/alsa-source.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 44f006b1f..5de52d542 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1203,6 +1203,9 @@ static int sink_process_msg(pa_msgobject *o, int code, 
void *data, int64_t offse
 
                     if (u->sink->thread_info.state == PA_SINK_INIT) {
                         if (build_pollfd(u) < 0)
+                            /* FIXME: This will cause an assertion failure in
+                             * pa_sink_put(), because with the current design
+                             * pa_sink_put() is not allowed to fail. */
                             return -PA_ERR_IO;
                     }
 
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 608cb0d63..cdafa580f 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1058,6 +1058,9 @@ static int source_process_msg(pa_msgobject *o, int code, 
void *data, int64_t off
 
                     if (u->source->thread_info.state == PA_SOURCE_INIT) {
                         if (build_pollfd(u) < 0)
+                            /* FIXME: This will cause an assertion failure in
+                             * pa_source_put(), because with the current design
+                             * pa_source_put() is not allowed to fail. */
                             return -PA_ERR_IO;
                     }
 
-- 
2.15.1

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to