diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-03-05 20:30:33 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-03-05 20:30:33 +0530 |
commit | a0706e7c84d8228f136e9d1c9894a5854cae7bde (patch) | |
tree | d501ec5fe6b896fd3e79c8f450b71040d278617f /src/pulsecore/sink-input.c | |
parent | 8baf8e90c2c6b8b1cb63658e7d46d770bb86560b (diff) |
format: Allow format->sample spec conversion for compressed formats
This allows clients to get a "fake" sample space for compressed formats
that we can support. This should make size/time conversion for things
like calculating buffer attributes simpler.
Diffstat (limited to 'src/pulsecore/sink-input.c')
-rw-r--r-- | src/pulsecore/sink-input.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 1e7d3e58..b8412bd0 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -292,15 +292,10 @@ int pa_sink_input_new( /* Now populate the sample spec and format according to the final * format that we've negotiated */ - if (PA_LIKELY(data->format->encoding == PA_ENCODING_PCM)) { - pa_return_val_if_fail(pa_format_info_to_sample_spec(data->format, &ss, &map) == 0, -PA_ERR_INVALID); - pa_sink_input_new_data_set_sample_spec(data, &ss); - if (pa_channel_map_valid(&map)) - pa_sink_input_new_data_set_channel_map(data, &map); - } else { - pa_return_val_if_fail(pa_format_info_to_sample_spec_fake(data->format, &ss) == 0, -PA_ERR_INVALID); - pa_sink_input_new_data_set_sample_spec(data, &ss); - } + pa_return_val_if_fail(pa_format_info_to_sample_spec(data->format, &ss, &map) == 0, -PA_ERR_INVALID); + pa_sink_input_new_data_set_sample_spec(data, &ss); + if (pa_format_info_is_pcm(data->format) && pa_channel_map_valid(&map)) + pa_sink_input_new_data_set_channel_map(data, &map); pa_return_val_if_fail(PA_SINK_IS_LINKED(pa_sink_get_state(data->sink)), -PA_ERR_BADSTATE); pa_return_val_if_fail(!data->sync_base || (data->sync_base->sink == data->sink && pa_sink_input_get_state(data->sync_base) == PA_SINK_INPUT_CORKED), -PA_ERR_INVALID); |