Skip to content

Commit 835caf6

Browse files
authored
Merge pull request xbmc#24363 from fritsch/pwsample
AESinkPipewire: Set Samplerate for the node
2 parents d2df90d + ee80a0c commit 835caf6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

xbmc/cores/AudioEngine/Sinks/pipewire/AESinkPipewire.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,15 @@ bool CAESinkPipewire::Initialize(AEAudioFormat& format, std::string& device)
410410
std::string fraction =
411411
StringUtils::Format("{}/{}", frames / DEFAULT_LATENCY_DIVIDER, format.m_sampleRate);
412412

413-
std::array<spa_dict_item, 5> items = {
413+
std::string srate = StringUtils::Format("1/{}", format.m_sampleRate);
414+
415+
std::array<spa_dict_item, 6> items = {
414416
SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_TYPE, "Audio"),
415417
SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY, "Playback"),
416418
SPA_DICT_ITEM_INIT(PW_KEY_APP_NAME, CCompileInfo::GetAppName()),
417419
SPA_DICT_ITEM_INIT(PW_KEY_NODE_NAME, CCompileInfo::GetAppName()),
418-
SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, fraction.c_str())};
420+
SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, fraction.c_str()),
421+
SPA_DICT_ITEM_INIT(PW_KEY_NODE_RATE, srate.c_str())};
419422

420423
auto properties = SPA_DICT_INIT(items.data(), items.size());
421424
m_stream->UpdateProperties(&properties);

0 commit comments

Comments
 (0)