mirror of https://github.com/mpv-player/mpv
ao_pipewire: add support for exclusive mode
This commit is contained in:
parent
c29692d81d
commit
83681de3c1
|
@ -1846,10 +1846,10 @@ Audio
|
||||||
Enable exclusive output mode. In this mode, the system is usually locked
|
Enable exclusive output mode. In this mode, the system is usually locked
|
||||||
out, and only mpv will be able to output audio.
|
out, and only mpv will be able to output audio.
|
||||||
|
|
||||||
This only works for some audio outputs, such as ``wasapi`` and
|
This only works for some audio outputs, such as ``wasapi``, ``coreaudio``
|
||||||
``coreaudio``. Other audio outputs silently ignore this options. They either
|
and ``pipewire``. Other audio outputs silently ignore this option.
|
||||||
have no concept of exclusive mode, or the mpv side of the implementation is
|
They either have no concept of exclusive mode, or the mpv side of the
|
||||||
missing.
|
implementation is missing.
|
||||||
|
|
||||||
``--audio-fallback-to-null=<yes|no>``
|
``--audio-fallback-to-null=<yes|no>``
|
||||||
If no audio device can be opened, behave as if ``--ao=null`` was given. This
|
If no audio device can be opened, behave as if ``--ao=null`` was given. This
|
||||||
|
|
|
@ -554,6 +554,9 @@ static int init(struct ao *ao)
|
||||||
PW_STREAM_FLAG_MAP_BUFFERS |
|
PW_STREAM_FLAG_MAP_BUFFERS |
|
||||||
PW_STREAM_FLAG_RT_PROCESS;
|
PW_STREAM_FLAG_RT_PROCESS;
|
||||||
|
|
||||||
|
if (ao->init_flags & AO_INIT_EXCLUSIVE)
|
||||||
|
flags |= PW_STREAM_FLAG_EXCLUSIVE;
|
||||||
|
|
||||||
if (pw_stream_connect(p->stream,
|
if (pw_stream_connect(p->stream,
|
||||||
PW_DIRECTION_OUTPUT, PW_ID_ANY, flags, params, 1) < 0) {
|
PW_DIRECTION_OUTPUT, PW_ID_ANY, flags, params, 1) < 0) {
|
||||||
pw_thread_loop_unlock(p->loop);
|
pw_thread_loop_unlock(p->loop);
|
||||||
|
|
Loading…
Reference in New Issue