summaryrefslogtreecommitdiff
path: root/src/pulsecore/source.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2017-12-28 12:09:18 +0200
committerTanu Kaskinen <tanuk@iki.fi>2018-01-03 16:27:16 +0200
commiteeee5664fad6d08c2757bc741db0955b0387b3b7 (patch)
treeecf6a1d68c7128ef44b77af10f9d9f138fa75bfe /src/pulsecore/source.c
parent94fc586c011537536cfb434376354699357af785 (diff)
downloadpulseaudio-eeee5664fad6d08c2757bc741db0955b0387b3b7.tar.gz
sink, source: improve state change logging
Now the old and new state is logged every time when the sink or source state changes.
Diffstat (limited to 'src/pulsecore/source.c')
-rw-r--r--src/pulsecore/source.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 6099c10d5..a0ab8e964 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -381,6 +381,7 @@ static int source_set_state(pa_source *s, pa_source_state_t state) {
return ret;
}
+ pa_log_debug("%s: state: %s -> %s", s->name, pa_source_state_to_string(s->state), pa_source_state_to_string(state));
s->state = state;
if (state != PA_SOURCE_UNLINKED) { /* if we enter UNLINKED state pa_source_unlink() will fire the appropriate events */
@@ -2014,6 +2015,19 @@ unsigned pa_source_check_suspend(pa_source *s, pa_source_output *ignore) {
return ret;
}
+const char *pa_source_state_to_string(pa_source_state_t state) {
+ switch (state) {
+ case PA_SOURCE_INIT: return "INIT";
+ case PA_SOURCE_IDLE: return "IDLE";
+ case PA_SOURCE_RUNNING: return "RUNNING";
+ case PA_SOURCE_SUSPENDED: return "SUSPENDED";
+ case PA_SOURCE_UNLINKED: return "UNLINKED";
+ case PA_SOURCE_INVALID_STATE: return "INVALID_STATE";
+ }
+
+ pa_assert_not_reached();
+}
+
/* Called from the IO thread */
static void sync_output_volumes_within_thread(pa_source *s) {
pa_source_output *o;