[pulseaudio-commits] src/modules

Arun Raghavan arun at kemper.freedesktop.org
Mon Sep 30 02:47:30 PDT 2013


 src/modules/alsa/alsa-ucm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5a2fd6624df0cb60b01ea6b67444842553b06a5b
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Sep 30 15:15:36 2013 +0530

    alsa-ucm: Fix bad rate check
    
    Need to check the rate value for being > 0 not the return value of
    pa_atou().

diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 2c0e87e..ef3ddb2 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 > 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 > 0 && ui < PA_RATE_MAX) {
                 pa_log_debug("UCM capture device %s rate %d", device_name, ui);
                 device->capture_rate = ui;
             } else



More information about the pulseaudio-commits mailing list