summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2012-11-19 07:22:28 (GMT)
committerArun Raghavan <arun.raghavan@collabora.co.uk>2012-11-19 07:40:36 (GMT)
commit3effdfc16fa4d51ac3a2ad8998eb25434e3087c0 (patch)
tree310c0a386778e63a3a7e0890ee2098e32ce6827e
parentda4163a85ebaa5e5794706b26b13ca11374dcf46 (diff)
downloadpulseaudio-3effdfc16fa4d51ac3a2ad8998eb25434e3087c0.tar.gz
pulseaudio-3effdfc16fa4d51ac3a2ad8998eb25434e3087c0.tar.xz
sink-input, source-output: Check rate update success for passthrough
This makes sure we don't try to plug in a passthrough stream if the final sink/source sample spec doesn't match what we want. In the future, we might want to change rate updates to try a full sample spec update for passthrough streams. https://bugs.freedesktop.org/show_bug.cgi?id=50951
-rw-r--r--src/pulsecore/sink-input.c8
-rw-r--r--src/pulsecore/source-output.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index a5edd21..aaabf5c 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -374,6 +374,14 @@ int pa_sink_input_new(
pa_log_info("Rate changed to %u Hz", data->sink->sample_spec.rate);
}
+ if (pa_sink_input_new_data_is_passthrough(data) &&
+ !pa_sample_spec_equal(&data->sample_spec, &data->sink->sample_spec)) {
+ /* rate update failed, or other parts of sample spec didn't match */
+
+ pa_log_debug("Could not update sink sample spec to match passthrough stream");
+ return -PA_ERR_NOTSUPPORTED;
+ }
+
/* Due to the fixing of the sample spec the volume might not match anymore */
pa_cvolume_remap(&data->volume, &original_cm, &data->channel_map);
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 6db2cbd..8775c1e 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -350,6 +350,14 @@ int pa_source_output_new(
pa_log_info("Rate changed to %u Hz", data->source->sample_spec.rate);
}
+ if (pa_source_output_new_data_is_passthrough(data) &&
+ !pa_sample_spec_equal(&data->sample_spec, &data->source->sample_spec)) {
+ /* rate update failed, or other parts of sample spec didn't match */
+
+ pa_log_debug("Could not update source sample spec to match passthrough stream");
+ return -PA_ERR_NOTSUPPORTED;
+ }
+
/* Due to the fixing of the sample spec the volume might not match anymore */
pa_cvolume_remap(&data->volume, &original_cm, &data->channel_map);