Commit 0825179f authored by Max Kellermann's avatar Max Kellermann

output/pipewire: add local reference variables

parent 97211d0a
...@@ -580,12 +580,14 @@ PipeWireOutput::Process() noexcept ...@@ -580,12 +580,14 @@ PipeWireOutput::Process() noexcept
return; return;
} }
auto *buf = b->buffer; auto &buffer = *b->buffer;
std::byte *dest = (std::byte *)buf->datas[0].data; auto &d = buffer.datas[0];
std::byte *dest = (std::byte *)d.data;
if (dest == nullptr) if (dest == nullptr)
return; return;
const std::size_t max_frames = buf->datas[0].maxsize / frame_size; const std::size_t max_frames = d.maxsize / frame_size;
const std::size_t max_size = max_frames * frame_size; const std::size_t max_size = max_frames * frame_size;
size_t nbytes = ring_buffer->pop(dest, max_size); size_t nbytes = ring_buffer->pop(dest, max_size);
...@@ -602,9 +604,10 @@ PipeWireOutput::Process() noexcept ...@@ -602,9 +604,10 @@ PipeWireOutput::Process() noexcept
LogWarning(pipewire_output_domain, "Decoder is too slow; playing silence to avoid xrun"); LogWarning(pipewire_output_domain, "Decoder is too slow; playing silence to avoid xrun");
} }
buf->datas[0].chunk->offset = 0; auto &chunk = *d.chunk;
buf->datas[0].chunk->stride = frame_size; chunk.offset = 0;
buf->datas[0].chunk->size = nbytes; chunk.stride = frame_size;
chunk.size = nbytes;
pw_stream_queue_buffer(stream, b); pw_stream_queue_buffer(stream, b);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment