summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/source-output.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-02-03 02:23:46 +0100
committerLennart Poettering <lennart@poettering.net>2009-02-03 02:23:46 +0100
commite47d03dea446d0387a7c07a470c9c680537d9c34 (patch)
tree59b0e807d5a3c56aa69421a8412972d7e154e748 /src/pulsecore/source-output.c
parentc61ad2a70619fc2fcec209838b37e047df2d1d2d (diff)
implement PA_STREAM_FAIL_ON_SUSPEND logic
Diffstat (limited to 'src/pulsecore/source-output.c')
-rw-r--r--src/pulsecore/source-output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 1e1ac4e1..9ef9b500 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -118,10 +118,13 @@ pa_source_output* pa_source_output_new(
}
pa_return_null_if_fail(data->source);
- pa_return_null_if_fail(pa_source_get_state(data->source) != PA_SOURCE_UNLINKED);
-
+ pa_return_null_if_fail(PA_SOURCE_IS_LINKED(pa_source_get_state(data->source)));
pa_return_null_if_fail(!data->direct_on_input || data->direct_on_input->sink == data->source->monitor_of);
+ if ((flags & PA_SOURCE_OUTPUT_FAIL_ON_SUSPEND) &&
+ pa_source_get_state(data->source) == PA_SOURCE_SUSPENDED)
+ return NULL;
+
if (!data->sample_spec_is_set)
data->sample_spec = data->source->sample_spec;