[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.17-13-gb4d4f2b

Lennart Poettering gitmailer-noreply at 0pointer.de
Wed Sep 16 18:59:53 PDT 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  231c17be0330a3621f5249c5c7ea0ce521085c61 (commit)

- Log -----------------------------------------------------------------
b4d4f2b cli: don't accidentaly set O_NDELAY on stderr
94f28b9 proplist: introduce PA_PROP_WINDOW_DESKTOP property
add4cbf position-event-sounds: don't warn that loud about vpos/hpos out of range
cdbeac6 libpulse: as a special exception, don't require a non-NULL context in pa_context_errno
-----------------------------------------------------------------------

Summary of changes:
 src/modules/module-cli.c                   |   24 +++++++++++++++++++++---
 src/modules/module-position-event-sounds.c |    5 +++--
 src/pulse/context.c                        |    5 ++++-
 src/pulse/proplist.h                       |    3 +++
 4 files changed, 31 insertions(+), 6 deletions(-)

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

commit cdbeac6b6961b5e071250f539b7011efe65ef513
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:37:23 2009 +0200

    libpulse: as a special exception, don't require a non-NULL context in pa_context_errno

diff --git a/src/pulse/context.c b/src/pulse/context.c
index 894ab2e..23ae30c 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -1045,7 +1045,10 @@ pa_context_state_t pa_context_get_state(pa_context *c) {
 }
 
 int pa_context_errno(pa_context *c) {
-    pa_assert(c);
+
+    if (!c)
+        return PA_ERR_INVALID;
+
     pa_assert(PA_REFCNT_VALUE(c) >= 1);
 
     return c->error;

commit add4cbf2f3e40131c03318d76c4c1e5208025ddc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 02:04:59 2009 +0200

    position-event-sounds: don't warn that loud about vpos/hpos out of range

diff --git a/src/modules/module-position-event-sounds.c b/src/modules/module-position-event-sounds.c
index fa8f73d..7221b14 100644
--- a/src/modules/module-position-event-sounds.c
+++ b/src/modules/module-position-event-sounds.c
@@ -65,8 +65,9 @@ static int parse_pos(const char *pos, double *f) {
     }
 
     if (*f < 0.0 || *f > 1.0) {
-        pa_log_warn("Property hpos/vpos out of range %0.2f", *f);
-        return -1;
+        pa_log_debug("Property hpos/vpos out of range %0.2f", *f);
+
+        *f = PA_CLAMP(*f, 0.0, 1.0);
     }
 
     return 0;

commit 94f28b9d4b7448c1e9bb6fb8a3b44f53988f6aa5
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 02:22:41 2009 +0200

    proplist: introduce PA_PROP_WINDOW_DESKTOP property

diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h
index 8bf9c48..8dff8df 100644
--- a/src/pulse/proplist.h
+++ b/src/pulse/proplist.h
@@ -115,6 +115,9 @@ PA_C_DECL_BEGIN
 /** For streams that belong to a window on the screen: relative position of the window center on the screen, float formatted as text string, ranging from 0.0 (top of the screen) to 1.0 (bottom of the screen). e.g. "0.43". \since 0.9.17 */
 #define PA_PROP_WINDOW_VPOS                    "window.vpos"
 
+/** For streams that belong to a window on the screen: if the windowing system supports multiple desktops, a comma seperated list of indexes of the desktops this window is visible on. If this property is an empty string, it is visible on all desktops (i.e. 'sticky'). The first desktop is 0. e.g. "0,2,3" \since 0.9.18 */
+#define PA_PROP_WINDOW_DESKTOP                 "window.desktop"
+
 /** For streams that belong to an X11 window on the screen: the X11 display string. e.g. ":0.0" */
 #define PA_PROP_WINDOW_X11_DISPLAY             "window.x11.display"
 

commit b4d4f2b856cd0d5e24f777a088b9d4462567dac0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 03:51:35 2009 +0200

    cli: don't accidentaly set O_NDELAY on stderr
    
    Loading module-cli could have the effect of setting O_NDELAY on stderr,
    because it was just a dup'ed fd of stdin which module-cli sets O_NDELAY
    for and which flag is shared between all dupes.
    
    Instead of using stdin/stdout directly we now open a new file descriptor
    for the controlling terminal, which is equally useful as stdin/stdout
    but gives a new file that does not share O_NDELAY with stdin/stdout.
    
    This solves a problem where when running pulseaudio -C resulted in
    log output being truncated since stdio does not really handle O_NDELAY
    that well in on its fds.

diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c
index fd9452b..60a9d46 100644
--- a/src/modules/module-cli.c
+++ b/src/modules/module-cli.c
@@ -25,6 +25,8 @@
 
 #include <stdio.h>
 #include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
 
 #include <pulsecore/module.h>
 #include <pulsecore/iochannel.h>
@@ -33,6 +35,8 @@
 #include <pulsecore/log.h>
 #include <pulsecore/modargs.h>
 #include <pulsecore/macro.h>
+#include <pulsecore/core-util.h>
+#include <pulsecore/core-error.h>
 
 #include "module-cli-symdef.h"
 
@@ -69,6 +73,7 @@ int pa__init(pa_module*m) {
     pa_iochannel *io;
     pa_modargs *ma;
     pa_bool_t exit_on_eof = FALSE;
+    int fd;
 
     pa_assert(m);
 
@@ -92,11 +97,24 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-    io = pa_iochannel_new(m->core->mainloop, STDIN_FILENO, STDOUT_FILENO);
-    pa_iochannel_set_noclose(io, 1);
+    /* We try to open the controlling tty anew here. This has the
+     * benefit of giving us a new fd that doesn't share the O_NDELAY
+     * flag with fds 0, 1, or 2. Since pa_iochannel_xxx needs O_NDELAY
+     * on its fd using those fds directly could set O_NDELAY which
+     * fprintf() doesn't really like, resulting in truncated output
+     * of log messages, particularly because if stdout and stderr are
+     * dup'ed they share the same O_NDELAY, too. */
+
+    if ((fd = open("/dev/tty", O_RDWR|O_CLOEXEC|O_NONBLOCK)) >= 0) {
+        io = pa_iochannel_new(m->core->mainloop, fd, fd);
+        pa_log_debug("Managed to open /dev/tty.");
+    } else {
+        io = pa_iochannel_new(m->core->mainloop, STDIN_FILENO, STDOUT_FILENO);
+        pa_iochannel_set_noclose(io, TRUE);
+        pa_log_debug("Failed to open /dev/tty, using stdin/stdout fds instead.");
+    }
 
     m->userdata = pa_cli_new(m->core, io, m);
-
     pa_cli_set_eof_callback(m->userdata, exit_on_eof ? eof_and_exit_cb : eof_and_unload_cb, m);
 
     pa_modargs_free(ma);

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list