mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
modernize a few checks
This commit is contained in:
parent
72024cda54
commit
ae83483cf0
2 changed files with 8 additions and 5 deletions
|
|
@ -124,14 +124,14 @@ pa_source_output* pa_source_output_new(
|
|||
pa_return_null_if_fail(pa_sample_spec_valid(&data->sample_spec));
|
||||
|
||||
if (!data->channel_map_is_set) {
|
||||
if (data->source->channel_map.channels == data->sample_spec.channels)
|
||||
if (pa_channel_map_compatible(&data->source->channel_map, &data->sample_spec))
|
||||
data->channel_map = data->source->channel_map;
|
||||
else
|
||||
pa_return_null_if_fail(pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT));
|
||||
}
|
||||
|
||||
pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));
|
||||
pa_return_null_if_fail(data->channel_map.channels == data->sample_spec.channels);
|
||||
pa_return_null_if_fail(pa_channel_map_compatible(&data->channel_map, &data->sample_spec));
|
||||
|
||||
if (flags & PA_SOURCE_OUTPUT_FIX_FORMAT)
|
||||
data->sample_spec.format = data->source->sample_spec.format;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue