[pulseaudio-commits] 2 commits - src/pulsecore src/utils

Arun Raghavan arun at kemper.freedesktop.org
Mon Jul 11 21:19:24 PDT 2011


 src/pulsecore/protocol-native.c |    4 +++-
 src/utils/padsp.c               |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 157bc4ef3bf11a0da25b2f97238c017f44f47085
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Jul 11 20:59:30 2011 -0700

    padsp: Handle eol in info callbacks correctly
    
    When receiving an eol, the object will be NULL and we're not handling
    this correctly. Thanks to Drew Ogle <dantealiegri at gmail.com> for
    reporting this and providing a patch.

diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index ab9d18a..2468d06 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -1222,7 +1222,7 @@ fail:
 static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, void *userdata) {
     fd_info *i = userdata;
 
-    if (!si || eol < 0) {
+    if (eol < 0) {
         i->operation_success = 0;
         pa_threaded_mainloop_signal(i->mainloop, 0);
         return;
@@ -1244,7 +1244,7 @@ static void sink_info_cb(pa_context *context, const pa_sink_info *si, int eol, v
 static void source_info_cb(pa_context *context, const pa_source_info *si, int eol, void *userdata) {
     fd_info *i = userdata;
 
-    if (!si || eol < 0) {
+    if (eol < 0) {
         i->operation_success = 0;
         pa_threaded_mainloop_signal(i->mainloop, 0);
         return;

commit f69cbdbdf7a0416202f882be8a65793fa57783c6
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Jul 11 20:52:41 2011 -0700

    protocol-native: Fix invalid assert
    
    For source and sinks, we allow both the index and name to be invalid
    while introspecting (the default source/sink will be used). This
    modifies the assert appropriately. Thanks to Drew Ogle
    <dantealiegri at gmail.com> for reporting and providing a patch.

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index f26750d..0fa4f1a 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -3390,7 +3390,9 @@ static void command_get_info(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
                    (command == PA_COMMAND_GET_SOURCE_INFO &&
                     pa_namereg_is_valid_name_or_wildcard(name, PA_NAMEREG_SOURCE)) ||
                    pa_namereg_is_valid_name(name), tag, PA_ERR_INVALID);
-    CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag, PA_ERR_INVALID);
+    CHECK_VALIDITY(c->pstream, command == PA_COMMAND_GET_SINK_INFO ||
+                   command == PA_COMMAND_GET_SOURCE_INFO ||
+                   (idx != PA_INVALID_INDEX || name), tag, PA_ERR_INVALID);
     CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag, PA_ERR_INVALID);
     CHECK_VALIDITY(c->pstream, !name || idx == PA_INVALID_INDEX, tag, PA_ERR_INVALID);
 



More information about the pulseaudio-commits mailing list