From: Arun Raghavan Date: Mon, 30 Sep 2013 03:02:16 +0000 (+0530) Subject: alsa-ucm: Don't allow Playback/CaptureRate to be 0 X-Git-Tag: accepted/tizen/20131022.162753~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24d2fa5415f660799a38295586298a96ba27b695;p=platform%2Fupstream%2Fpulseaudio.git alsa-ucm: Don't allow Playback/CaptureRate to be 0 This was a review comment on the original patch that I missed fixing. --- diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c index 47ff926e2..2c0e87eba 100644 --- a/src/modules/alsa/alsa-ucm.c +++ b/src/modules/alsa/alsa-ucm.c @@ -263,7 +263,7 @@ static int ucm_get_device_property( /* get rate */ if ((value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_PLAYBACK_RATE)) || (value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_PLAYBACK_RATE))) { - if (pa_atou(value, &ui) == 0 && ui < PA_RATE_MAX) { + if (pa_atou(value, &ui) > 0 && ui < PA_RATE_MAX) { pa_log_debug("UCM playback device %s rate %d", device_name, ui); device->playback_rate = ui; } else @@ -284,7 +284,7 @@ static int ucm_get_device_property( /* get rate */ if ((value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_RATE)) || (value = pa_proplist_gets(verb->proplist, PA_ALSA_PROP_UCM_CAPTURE_RATE))) { - if (pa_atou(value, &ui) == 0 && ui < PA_RATE_MAX) { + if (pa_atou(value, &ui) > 0 && ui < PA_RATE_MAX) { pa_log_debug("UCM capture device %s rate %d", device_name, ui); device->capture_rate = ui; } else