1
mirror of https://github.com/mpv-player/mpv synced 2025-03-15 03:14:30 +01:00

Replace deprecated jack_client_new with jack_client_open.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28241 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-01-04 11:51:11 +00:00
parent a4a6c32f2d
commit 4b5c66af76
2 changed files with 13 additions and 2 deletions

View File

@ -2757,6 +2757,9 @@ Useful if you want to have certain connections established automatically.
.IPs (no)estimate .IPs (no)estimate
Estimate the audio delay, supposed to make the video playback smoother Estimate the audio delay, supposed to make the video playback smoother
(default: enabled). (default: enabled).
.IPs (no)autostart (default: disabled)
Automatically start jackd if necessary.
Note that this seems unreliable and will spam stdout with server messages.
.RE .RE
.PD 1 .PD 1
. .

View File

@ -227,19 +227,25 @@ static void print_help (void)
" name=<client name>\n" " name=<client name>\n"
" Client name to pass to JACK\n" " Client name to pass to JACK\n"
" estimate\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) { static int init(int rate, int channels, int format, int flags) {
const char **matching_ports = NULL; const char **matching_ports = NULL;
char *port_name = NULL; char *port_name = NULL;
char *client_name = NULL; char *client_name = NULL;
int autostart = 0;
opt_t subopts[] = { opt_t subopts[] = {
{"port", OPT_ARG_MSTRZ, &port_name, NULL}, {"port", OPT_ARG_MSTRZ, &port_name, NULL},
{"name", OPT_ARG_MSTRZ, &client_name, NULL}, {"name", OPT_ARG_MSTRZ, &client_name, NULL},
{"estimate", OPT_ARG_BOOL, &estimate, NULL}, {"estimate", OPT_ARG_BOOL, &estimate, NULL},
{"autostart", OPT_ARG_BOOL, &autostart, NULL},
{NULL} {NULL}
}; };
jack_options_t open_options = JackUseExactName;
int port_flags = JackPortIsInput; int port_flags = JackPortIsInput;
int i; int i;
estimate = 1; estimate = 1;
@ -255,7 +261,9 @@ static int init(int rate, int channels, int format, int flags) {
client_name = malloc(40); client_name = malloc(40);
sprintf(client_name, "MPlayer [%d]", getpid()); 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) { if (!client) {
mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n"); mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] cannot open server\n");
goto err_out; goto err_out;