From dfa3c507001d583574a04cf87ed1f0123553ddac Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Tue, 3 Dec 2013 16:45:45 +0200 Subject: format: Simplify pa_format_info_to_sample_spec() --- src/pulse/format.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/pulse') diff --git a/src/pulse/format.c b/src/pulse/format.c index 4f4b3425d..9b42cdbda 100644 --- a/src/pulse/format.c +++ b/src/pulse/format.c @@ -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; - - ret = 0; + return -PA_ERR_INVALID; -out: - return ret; + return 0; } pa_prop_type_t pa_format_info_get_prop_type(pa_format_info *f, const char *key) { -- cgit v1.2.3