diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-05-13 21:33:22 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2013-05-22 17:20:21 +0530 |
commit | ae9f6dc35638b6ac3609cb7dc110d859388a6c24 (patch) | |
tree | 5d8b059331975fa97f84f67298413d839e69ef22 /src/pulsecore/sink-input.c | |
parent | b156325c68f1e542a57f854c5996fafd1a79d602 (diff) | |
download | pulseaudio-ae9f6dc35638b6ac3609cb7dc110d859388a6c24.tar.gz |
sink-input,source-output: Deal with FIX* flags and extended API
The sample spec fixup when FIX* flags are set was not being propagated
to the pa_format_info, causing the two to be out of sync when FIX* was
used.
Diffstat (limited to 'src/pulsecore/sink-input.c')
-rw-r--r-- | src/pulsecore/sink-input.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 8b9ee72be..db296965b 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -384,17 +384,26 @@ int pa_sink_input_new( if (!data->muted_is_set) data->muted = FALSE; - if (data->flags & PA_SINK_INPUT_FIX_FORMAT) + if (data->flags & PA_SINK_INPUT_FIX_FORMAT) { + pa_return_val_if_fail(pa_format_info_is_pcm(data->format), -PA_ERR_INVALID); data->sample_spec.format = data->sink->sample_spec.format; + pa_format_info_set_sample_format(data->format, data->sample_spec.format); + } - if (data->flags & PA_SINK_INPUT_FIX_RATE) + if (data->flags & PA_SINK_INPUT_FIX_RATE) { + pa_return_val_if_fail(pa_format_info_is_pcm(data->format), -PA_ERR_INVALID); data->sample_spec.rate = data->sink->sample_spec.rate; + pa_format_info_set_rate(data->format, data->sample_spec.rate); + } original_cm = data->channel_map; if (data->flags & PA_SINK_INPUT_FIX_CHANNELS) { + pa_return_val_if_fail(pa_format_info_is_pcm(data->format), -PA_ERR_INVALID); data->sample_spec.channels = data->sink->sample_spec.channels; data->channel_map = data->sink->channel_map; + pa_format_info_set_channels(data->format, data->sample_spec.channels); + pa_format_info_set_channel_map(data->format, &data->channel_map); } pa_assert(pa_sample_spec_valid(&data->sample_spec)); |