diff options
author | Chris Robinson <[email protected]> | 2023-08-30 23:45:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-08-30 23:45:15 -0700 |
commit | c53ee243ec5af8392a15d4e315b36dec4b5f41cf (patch) | |
tree | 1cf530785588c060311c547d1169ef01224d1399 | |
parent | d2abe6ca2b3d20f35a615b920ef1e12d9eb6d6a1 (diff) |
Combine separate loops into one
-rw-r--r-- | alc/backends/pipewire.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp index ede4399b..6a39df72 100644 --- a/alc/backends/pipewire.cpp +++ b/alc/backends/pipewire.cpp @@ -1444,16 +1444,14 @@ void PipeWirePlayback::outputCallback() noexcept length = minu(length, data.maxsize/sizeof(float)); *chanptr_end = static_cast<float*>(data.data); ++chanptr_end; - } - - mDevice->renderSamples({mChannelPtrs.get(), chanptr_end}, length); - for(const auto &data : datas) - { data.chunk->offset = 0; data.chunk->stride = sizeof(float); data.chunk->size = length * sizeof(float); } + + mDevice->renderSamples({mChannelPtrs.get(), chanptr_end}, length); + pw_buf->size = length; pw_stream_queue_buffer(mStream.get(), pw_buf); } @@ -1745,7 +1743,10 @@ void PipeWirePlayback::start() } #endif if(!--wait_count) + { + ERR("Timeout getting PipeWire stream buffering info\n"); break; + } plock.unlock(); std::this_thread::sleep_for(milliseconds{20}); |