mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
format: Simplify pa_format_info_to_sample_spec()
This commit is contained in:
parent
3a5a0f6652
commit
dfa3c50700
1 changed files with 5 additions and 10 deletions
|
|
@ -218,8 +218,6 @@ pa_format_info* pa_format_info_from_sample_spec(pa_sample_spec *ss, pa_channel_m
|
|||
|
||||
/* For PCM streams */
|
||||
int pa_format_info_to_sample_spec(pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map) {
|
||||
int ret = -PA_ERR_INVALID;
|
||||
|
||||
pa_assert(f);
|
||||
pa_assert(ss);
|
||||
|
||||
|
|
@ -227,18 +225,15 @@ int pa_format_info_to_sample_spec(pa_format_info *f, pa_sample_spec *ss, pa_chan
|
|||
return pa_format_info_to_sample_spec_fake(f, ss, map);
|
||||
|
||||
if (pa_format_info_get_sample_format(f, &ss->format) < 0)
|
||||
goto out;
|
||||
return -PA_ERR_INVALID;
|
||||
if (pa_format_info_get_rate(f, &ss->rate) < 0)
|
||||
goto out;
|
||||
return -PA_ERR_INVALID;
|
||||
if (pa_format_info_get_channels(f, &ss->channels) < 0)
|
||||
goto out;
|
||||
return -PA_ERR_INVALID;
|
||||
if (map && pa_format_info_get_channel_map(f, map) < 0)
|
||||
goto out;
|
||||
return -PA_ERR_INVALID;
|
||||
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pa_prop_type_t pa_format_info_get_prop_type(pa_format_info *f, const char *key) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue