diff options
author | Nicolas F <ovdev@fratti.ch> | 2020-06-10 17:45:43 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-08-20 20:30:53 +0200 |
commit | 9ba8b921cfb3e461958656a2e2d7c1c6c2abb677 (patch) | |
tree | 588b4eaf9ebf44f634d67bcb41d72c90cc44a2d7 /audio/out | |
parent | 68276e2672bd2422ea6b4be3af4abfa0f1f7f258 (diff) | |
download | mpv-9ba8b921cfb3e461958656a2e2d7c1c6c2abb677.tar.bz2 mpv-9ba8b921cfb3e461958656a2e2d7c1c6c2abb677.tar.xz |
ao/jack: set device_buffer to JACK buffer size
This change sets the device_buffer member of the ao struct for
the JACK ao to whatever value we read during init.
While JACK allows changing the audio buffer size on-the-fly
(you can do this for example through DBus), having it somehow
reconfigure the entire audio buffer logic of mpv that depends
on device_buffer in some way when that happens only leads to
audio dropout and weird code. device_buffer's role is mostly for
prebuffer from what I understand, which means that simply setting
it to its current value in the init function is fine.
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_jack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c index 0901fec36b..f55974b1e8 100644 --- a/audio/out/ao_jack.c +++ b/audio/out/ao_jack.c @@ -246,6 +246,8 @@ static int init(struct ao *ao) jack_set_process_callback(p->client, process, ao); ao->samplerate = jack_get_sample_rate(p->client); + // The actual device buffer can change, but this is enough for pre-buffer + ao->device_buffer = jack_get_buffer_size(p->client); jack_set_buffer_size_callback(p->client, buffer_size_cb, ao); jack_set_graph_order_callback(p->client, graph_order_cb, ao); |