summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:07:09 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:57:31 +0200
commit9bcd12fdf5c6f85e9bb391caa2713021624a957e (patch)
tree375eac533ead90a45e7121e5ab307861b4ef52c8 /libao2
parentd419ecd161634e79dab3ac57d57c4bccba2adcdc (diff)
parente0d66b140e1da7a793bff15003cadab79544b1dd (diff)
downloadmpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.bz2
mpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.xz
Merge svn changes up to r28310
The libdvdread4 and libdvdnav directories, which are externals in the svn repository, are at least for now not included in any form. I added configure checks to automatically disable internal libdvdread and libdvdnav if the corresponding directories are not present; if they're added manually then things work the same as in svn.
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_jack.c12
-rw-r--r--libao2/ao_nas.c16
2 files changed, 18 insertions, 10 deletions
diff --git a/libao2/ao_jack.c b/libao2/ao_jack.c
index e4ac6910b2..d7f2092a43 100644
--- a/libao2/ao_jack.c
+++ b/libao2/ao_jack.c
@@ -227,19 +227,25 @@ static void print_help (void)
" name=<client name>\n"
" Client name to pass to JACK\n"
" estimate\n"
- " Estimates the amount of data in buffers (experimental)\n");
+ " Estimates the amount of data in buffers (experimental)\n"
+ " autostart\n"
+ " Automatically start JACK server if necessary\n"
+ );
}
static int init(int rate, int channels, int format, int flags) {
const char **matching_ports = NULL;
char *port_name = NULL;
char *client_name = NULL;
+ int autostart = 0;
opt_t subopts[] = {
{"port", OPT_ARG_MSTRZ, &port_name, NULL},
{"name", OPT_ARG_MSTRZ, &client_name, NULL},
{"estimate", OPT_ARG_BOOL, &estimate, NULL},
+ {"autostart", OPT_ARG_BOOL, &autostart, NULL},
{NULL}
};
+ jack_options_t open_options = JackUseExactName;
int port_flags = JackPortIsInput;
int i;
estimate = 1;
@@ -255,7 +261,9 @@ static int init(int rate, int channels, int format, int flags) {
client_name = malloc(40);
sprintf(client_name, "MPlayer [%d]", getpid());
}
- client = jack_client_new(client_name);
+ if (!autostart)
+ open_options |= JackNoStartServer;
+ client = jack_client_open(client_name, open_options, NULL);
if (!client) {
mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n");
goto err_out;
diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c
index 5428c7489f..92ca56a35f 100644
--- a/libao2/ao_nas.c
+++ b/libao2/ao_nas.c
@@ -44,7 +44,7 @@
/* NAS_FRAG_SIZE must be a power-of-two value */
#define NAS_FRAG_SIZE 4096
-static char *nas_event_types[] = {
+static const char * const nas_event_types[] = {
"Undefined",
"Undefined",
"ElementNotify",
@@ -54,21 +54,21 @@ static char *nas_event_types[] = {
"DeviceNotify"
};
-static char *nas_elementnotify_kinds[] = {
+static const char * const nas_elementnotify_kinds[] = {
"LowWater",
"HighWater",
"State",
"Unknown"
};
-static char *nas_states[] = {
+static const char * const nas_states[] = {
"Stop",
"Start",
"Pause",
"Any"
};
-static char *nas_reasons[] = {
+static const char * const nas_reasons[] = {
"User",
"Underrun",
"Overrun",
@@ -78,24 +78,24 @@ static char *nas_reasons[] = {
"Any"
};
-static char* nas_reason(unsigned int reason)
+static const char* nas_reason(unsigned int reason)
{
if (reason > 6) reason = 6;
return nas_reasons[reason];
}
-static char* nas_elementnotify_kind(unsigned int kind)
+static const char* nas_elementnotify_kind(unsigned int kind)
{
if (kind > 2) kind = 3;
return nas_elementnotify_kinds[kind];
}
-static char* nas_event_type(unsigned int type) {
+static const char* nas_event_type(unsigned int type) {
if (type > 6) type = 0;
return nas_event_types[type];
}
-static char* nas_state(unsigned int state) {
+static const char* nas_state(unsigned int state) {
if (state>3) state = 3;
return nas_states[state];
}