[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test3-21-g77514c1

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Mar 2 05:17:29 PST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  ba4765a0dce7dfe9926999b83396f13d35288365 (commit)

- Log -----------------------------------------------------------------
77514c1... Merge commit 'coling/master'
5c514aa... make dependency on udev versioned
8a00c00... raop: Handle the reponse header memory allocation more sensibly.
b75a4b4... raop: Log teardown explicitly
d293f08... raop: Allow for nice sink descriptions to be set (interpolated from avahi)
8fc9b19... Don't assume that device reservation is enabled.
-----------------------------------------------------------------------

Summary of changes:
 configure.ac                       |    2 +-
 src/modules/alsa/alsa-sink.c       |    2 +-
 src/modules/alsa/alsa-source.c     |    2 +-
 src/modules/module-raop-discover.c |   27 ++++++++++++++---
 src/modules/module-raop-sink.c     |    9 ++++-
 src/modules/raop/raop_client.c     |    4 ++
 src/modules/rtp/rtsp_client.c      |   56 +++++++++++++++++------------------
 7 files changed, 63 insertions(+), 39 deletions(-)

-----------------------------------------------------------------------

commit 8fc9b19cb314329487a62a15c523e9778298f1d5
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Sat Feb 28 23:45:02 2009 +0000

    Don't assume that device reservation is enabled.
    
    In the case when the alsa 'device' is not a physical card, it wont have an index and thus
    the reservation name will be NULL and therefore we will not initialise the reservation system.
    
    Fixes #498

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 0aef1bd..708e020 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -148,7 +148,7 @@ static void reserve_update(struct userdata *u) {
     const char *description;
     pa_assert(u);
 
-    if (!u->sink)
+    if (!u->sink || !u->reserve)
         return;
 
     if ((description = pa_proplist_gets(u->sink->proplist, PA_PROP_DEVICE_DESCRIPTION)))
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 671df3f..4321c7f 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -146,7 +146,7 @@ static void reserve_update(struct userdata *u) {
     const char *description;
     pa_assert(u);
 
-    if (!u->source)
+    if (!u->source || !u->reserve)
         return;
 
     if ((description = pa_proplist_gets(u->source->proplist, PA_PROP_DEVICE_DESCRIPTION)))

commit d293f08442ee750373257dd3f769f14bfbef3432
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Sun Mar 1 18:10:35 2009 +0000

    raop: Allow for nice sink descriptions to be set (interpolated from avahi)

diff --git a/src/modules/module-raop-discover.c b/src/modules/module-raop-discover.c
index df39315..7df549e 100644
--- a/src/modules/module-raop-discover.c
+++ b/src/modules/module-raop-discover.c
@@ -152,11 +152,18 @@ static void resolver_cb(
     if (event != AVAHI_RESOLVER_FOUND)
         pa_log("Resolving of '%s' failed: %s", name, avahi_strerror(avahi_client_errno(u->client)));
     else {
-        char *device = NULL, *dname, *vname, *args;
+        char *device = NULL, *nicename, *dname, *vname, *args;
         char at[AVAHI_ADDRESS_STR_MAX];
         AvahiStringList *l;
         pa_module *m;
 
+        if ((nicename = strstr(name, "@"))) {
+            ++nicename;
+            if (strlen(nicename) > 0) {
+                pa_log_debug("Found RAOP: %s", nicename);
+            }
+        }
+
         for (l = txt; l; l = l->next) {
             char *key, *value;
             pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0);
@@ -190,10 +197,20 @@ static void resolver_cb(
                                  "sink_name=%s",
                                  avahi_address_snprint(at, sizeof(at), a), port,
                                  vname);*/
-        args = pa_sprintf_malloc("server=%s "
-                                 "sink_name=%s",
-                                 avahi_address_snprint(at, sizeof(at), a),
-                                 vname);
+        if (nicename) {
+            args = pa_sprintf_malloc("server=%s "
+                                     "sink_name=%s "
+                                     "description=\"%s\"",
+                                     avahi_address_snprint(at, sizeof(at), a),
+                                     vname,
+                                     nicename);
+
+        } else {
+            args = pa_sprintf_malloc("server=%s "
+                                     "sink_name=%s",
+                                     avahi_address_snprint(at, sizeof(at), a),
+                                     vname);
+        }
 
         pa_log_debug("Loading module-raop-sink with arguments '%s'", args);
 
diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c
index da338f5..88fc6f1 100644
--- a/src/modules/module-raop-sink.c
+++ b/src/modules/module-raop-sink.c
@@ -72,6 +72,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "description=<description for the sink> "
         "server=<address>  "
         "format=<sample format> "
         "channels=<number of channels> "
@@ -122,6 +123,7 @@ static const char* const valid_modargs[] = {
     "format",
     "channels",
     "sink_name",
+    "description",
     NULL
 };
 
@@ -502,7 +504,7 @@ int pa__init(pa_module*m) {
     struct userdata *u = NULL;
     pa_sample_spec ss;
     pa_modargs *ma = NULL;
-    const char *server;
+    const char *server, *desc;
     pa_sink_new_data data;
 
     pa_assert(m);
@@ -564,7 +566,10 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, server);
-    pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server);
+    if ((desc = pa_modargs_get_value(ma, "description", NULL)))
+        pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, desc);
+    else
+        pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server);
 
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_NETWORK);
     pa_sink_new_data_done(&data);

commit b75a4b437a6527c2506a9e19fb9025b2841f90df
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Sun Mar 1 18:11:36 2009 +0000

    raop: Log teardown explicitly

diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index 4627545..0cc67ae 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -339,9 +339,13 @@ static void rtsp_cb(pa_rtsp_client *rtsp, pa_rtsp_state state, pa_headerlist* he
             break;
 
         case STATE_TEARDOWN:
+            pa_log_debug("RAOP: TEARDOWN");
+            break;
+
         case STATE_SET_PARAMETER:
             pa_log_debug("RAOP: SET_PARAMETER");
             break;
+
         case STATE_DISCONNECTED:
             pa_assert(c->closed_callback);
             pa_assert(c->rtsp);

commit 8a00c009439d1c559a2992b2f9f67e2708334d5a
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Sun Mar 1 23:17:07 2009 +0000

    raop: Handle the reponse header memory allocation more sensibly.
    
    In theory the callback called after reading headers could free our whole object, so we should not
    take it upon ourselves to free the headers after the call to the callback.

diff --git a/src/modules/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c
index 9eb3d96..3b077be 100644
--- a/src/modules/rtp/rtsp_client.c
+++ b/src/modules/rtp/rtsp_client.c
@@ -101,26 +101,27 @@ pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostna
 
 
 void pa_rtsp_client_free(pa_rtsp_client* c) {
-    if (c) {
-        if (c->sc)
-            pa_socket_client_unref(c->sc);
-        if (c->ioline)
-            pa_ioline_close(c->ioline);
-        else if (c->io)
-            pa_iochannel_free(c->io);
-
-        pa_xfree(c->hostname);
-        pa_xfree(c->url);
-        pa_xfree(c->localip);
-        pa_xfree(c->session);
-        pa_xfree(c->transport);
-        pa_xfree(c->last_header);
-        if (c->header_buffer)
-            pa_strbuf_free(c->header_buffer);
-        if (c->response_headers)
-            pa_headerlist_free(c->response_headers);
-        pa_headerlist_free(c->headers);
-    }
+    pa_assert(c);
+
+    if (c->sc)
+        pa_socket_client_unref(c->sc);
+    if (c->ioline)
+        pa_ioline_close(c->ioline);
+    else if (c->io)
+        pa_iochannel_free(c->io);
+
+    pa_xfree(c->hostname);
+    pa_xfree(c->url);
+    pa_xfree(c->localip);
+    pa_xfree(c->session);
+    pa_xfree(c->transport);
+    pa_xfree(c->last_header);
+    if (c->header_buffer)
+        pa_strbuf_free(c->header_buffer);
+    if (c->response_headers)
+        pa_headerlist_free(c->response_headers);
+    pa_headerlist_free(c->headers);
+
     pa_xfree(c);
 }
 
@@ -141,8 +142,6 @@ static void headers_read(pa_rtsp_client *c) {
         c->transport = pa_xstrdup(pa_headerlist_gets(c->response_headers, "Transport"));
 
         if (!c->session || !c->transport) {
-            pa_headerlist_free(c->response_headers);
-            c->response_headers = NULL;
             pa_log("Invalid SETUP response.");
             return;
         }
@@ -160,8 +159,6 @@ static void headers_read(pa_rtsp_client *c) {
         }
         if (0 == c->rtp_port) {
             /* Error no server_port in response */
-            pa_headerlist_free(c->response_headers);
-            c->response_headers = NULL;
             pa_log("Invalid SETUP response (no port number).");
             return;
         }
@@ -169,9 +166,6 @@ static void headers_read(pa_rtsp_client *c) {
 
     /* Call our callback */
     c->callback(c, c->state, c->response_headers, c->userdata);
-
-    pa_headerlist_free(c->response_headers);
-    c->response_headers = NULL;
 }
 
 
@@ -201,7 +195,8 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
     }
     if (c->waiting && 0 == strcmp("RTSP/1.0 200 OK", s2)) {
         c->waiting = 0;
-        pa_assert(!c->response_headers);
+        if (c->response_headers)
+            pa_headerlist_free(c->response_headers);
         c->response_headers = pa_headerlist_new();
         goto exit;
     }
@@ -353,9 +348,12 @@ void pa_rtsp_set_callback(pa_rtsp_client *c, pa_rtsp_cb_t callback, void *userda
 void pa_rtsp_disconnect(pa_rtsp_client *c) {
     pa_assert(c);
 
-    if (c->io)
+    if (c->ioline)
+        pa_ioline_close(c->ioline);
+    else if (c->io)
         pa_iochannel_free(c->io);
     c->io = NULL;
+    c->ioline = NULL;
 }
 
 

commit 5c514aaacc5f90a7bf9a3536ef5d3aefaad1c55c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 2 14:06:23 2009 +0100

    make dependency on udev versioned

diff --git a/configure.ac b/configure.ac
index b213129..77d777d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -990,7 +990,7 @@ AC_ARG_ENABLE([udev],
         ],
         [udev=auto])
 if test "x${udev}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
-    PKG_CHECK_MODULES(UDEV, [ libudev ],
+    PKG_CHECK_MODULES(UDEV, [ libudev >= 137 ],
         [
             HAVE_UDEV=1
             AC_DEFINE([HAVE_UDEV], 1, [Have UDEV.])

commit 77514c1c4cfd4154371fb7b745772a02c5932ec2
Merge: 5c514aa... 8a00c00...
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 2 14:08:11 2009 +0100

    Merge commit 'coling/master'


-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list