[MPlayer-cvslog] r34784 - in trunk: DOCS/man/en/mplayer.1 libao2/ao_pulse.c

reimar subversion at mplayerhq.hu
Sat Mar 3 15:03:18 CET 2012


Author: reimar
Date: Sat Mar  3 15:03:18 2012
New Revision: 34784

Log:
Add suboption parsing support to ao_pulse and add an
option to override auto-detection of broken pause detection.

Modified:
   trunk/libao2/ao_pulse.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c	Sat Mar  3 14:44:46 2012	(r34783)
+++ trunk/libao2/ao_pulse.c	Sat Mar  3 15:03:18 2012	(r34784)
@@ -30,6 +30,7 @@
 #include "mp_msg.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
+#include "subopt-helper.h"
 
 #define PULSE_CLIENT_NAME "MPlayer"
 
@@ -134,6 +135,11 @@ static const struct format_map_s {
     {AF_FORMAT_UNKNOWN, 0}
 };
 
+static const opt_t subopts[] = {
+    {"broken_pause", OPT_ARG_BOOL, &broken_pause, NULL},
+    {NULL}
+};
+
 static int init(int rate_hz, int channels, int format, int flags) {
     struct pa_sample_spec ss;
     struct pa_channel_map map;
@@ -143,22 +149,31 @@ static int init(int rate_hz, int channel
     char *sink = NULL;
     const char *version = pa_get_library_version();
 
+    broken_pause = -1;
     if (ao_subdevice) {
+        char *opts;
         devarg = strdup(ao_subdevice);
         sink = strchr(devarg, ':');
         if (sink) *sink++ = 0;
         if (devarg[0]) host = devarg;
+        opts = strchr(sink, ':');
+        if (opts) {
+            *opts++ = 0;
+            if (!sink[0]) sink = NULL;
+            if (subopt_parse(opts, subopts))
+                goto fail;
+        }
     }
 
-    broken_pause = 0;
     // not sure which versions are affected, assume 0.9.11* to 0.9.14*
     // known bad: 0.9.14, 0.9.13
     // known good: 0.9.9, 0.9.10, 0.9.15
     // to test: pause, wait ca. 5 seconds framestep and see if MPlayer hangs somewhen
-    if (strncmp(version, "0.9.1", 5) == 0 && version[5] >= '1' && version[5] <= '4') {
+    if (broken_pause == -1)
+        broken_pause = strncmp(version, "0.9.1", 5) == 0 && version[5] >= '1' && version[5] <= '4';
+    if (broken_pause) {
         mp_msg(MSGT_AO, MSGL_WARN, "[pulse] working around probably broken pause functionality,\n"
                                    "        see http://www.pulseaudio.org/ticket/440\n");
-        broken_pause = 1;
     }
 
     ss.channels = channels;


More information about the MPlayer-cvslog mailing list