output/pipewire: attempt to change the graph sample rate
Requires PipeWire 0.3.32. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1283
This commit is contained in:
parent
c112cb60da
commit
d5be8c74b0
1
NEWS
1
NEWS
|
@ -1,5 +1,6 @@
|
||||||
ver 0.23.1 (not yet released)
|
ver 0.23.1 (not yet released)
|
||||||
* output
|
* output
|
||||||
|
- pipewire: attempt to change the graph sample rate
|
||||||
- snapcast: fix time stamp bug which caused "Failed to get chunk"
|
- snapcast: fix time stamp bug which caused "Failed to get chunk"
|
||||||
* fix libfmt linker problems
|
* fix libfmt linker problems
|
||||||
* fix broken password authentication
|
* fix broken password authentication
|
||||||
|
|
|
@ -383,6 +383,13 @@ PipeWireOutput::Open(AudioFormat &audio_format)
|
||||||
if (target != nullptr && target_id == PW_ID_ANY)
|
if (target != nullptr && target_id == PW_ID_ANY)
|
||||||
pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);
|
pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);
|
||||||
|
|
||||||
|
#ifdef PW_KEY_NODE_RATE
|
||||||
|
/* ask PipeWire to change the graph sample rate to ours
|
||||||
|
(requires PipeWire 0.3.32) */
|
||||||
|
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u",
|
||||||
|
audio_format.sample_rate);
|
||||||
|
#endif
|
||||||
|
|
||||||
const PipeWire::ThreadLoopLock lock(thread_loop);
|
const PipeWire::ThreadLoopLock lock(thread_loop);
|
||||||
|
|
||||||
stream = pw_stream_new_simple(pw_thread_loop_get_loop(thread_loop),
|
stream = pw_stream_new_simple(pw_thread_loop_get_loop(thread_loop),
|
||||||
|
|
Loading…
Reference in New Issue