diff options
author | Térence Clastres <t.clastres@gmail.com> | 2019-05-05 06:53:41 +0200 |
---|---|---|
committer | wm4 <1387750+wm4@users.noreply.github.com> | 2019-09-21 12:54:36 +0200 |
commit | 41f4e8d73ab93e64ec6ac3f7f999445236577374 (patch) | |
tree | 1691a9d0f24143940f822214064248bcb0dfdae2 | |
parent | abfc58cad424fb9a023d0334e20fd34d63f887a7 (diff) | |
download | mpv-41f4e8d73ab93e64ec6ac3f7f999445236577374.tar.bz2 mpv-41f4e8d73ab93e64ec6ac3f7f999445236577374.tar.xz |
ao_pulse: add --pulse-allow-suspended
This flag makes mpv continue using the PulseAudio driver even if the
sink is suspended.
This can be useful if JACK is running with PulseAudio in bridge mode and
the sink-input assigned to mpv is the one JACK controls, thus being
suspended.
By forcing mpv to still use PulseAudio in this case, the user can now
adjust the sink to an unsuspended one.
-rw-r--r-- | DOCS/man/ao.rst | 4 | ||||
-rw-r--r-- | audio/out/ao_pulse.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/DOCS/man/ao.rst b/DOCS/man/ao.rst index 04994058c3..a0c5052b46 100644 --- a/DOCS/man/ao.rst +++ b/DOCS/man/ao.rst @@ -152,6 +152,10 @@ Available audio output drivers are: If you have stuttering video when using pulse, try to enable this option. (Or try to update PulseAudio.) + ``--pulse-allow-suspended=<yes|no>`` + Allow mpv to use PulseAudio even if the sink is suspended (default: no). + Can be useful if PulseAudio is running as a bridge to jack and mpv has its sink-input set to the one jack is using. + ``sdl`` SDL 1.2+ audio output driver. Should work on any platform supported by SDL 1.2, but may require the ``SDL_AUDIODRIVER`` environment variable to be set diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index e288841788..7363a56c1e 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -61,6 +61,7 @@ struct priv { char *cfg_host; int cfg_buffer; int cfg_latency_hacks; + int cfg_allow_suspended; }; #define GENERIC_ERR_MSG(str) \ @@ -482,7 +483,7 @@ static int init(struct ao *ao) pa_threaded_mainloop_wait(priv->mainloop); } - if (pa_stream_is_suspended(priv->stream)) { + if (pa_stream_is_suspended(priv->stream) && !priv->cfg_allow_suspended) { MP_ERR(ao, "The stream is suspended. Bailing out.\n"); goto unlock_and_fail; } @@ -837,6 +838,7 @@ const struct ao_driver audio_out_pulse = { OPT_STRING("host", cfg_host, 0), OPT_CHOICE_OR_INT("buffer", cfg_buffer, 0, 1, 2000, ({"native", 0})), OPT_FLAG("latency-hacks", cfg_latency_hacks, 0), + OPT_FLAG("allow-suspended", cfg_allow_suspended, 0), {0} }, .options_prefix = "pulse", |