mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
spa: improve draining
Make a new DRAINED status. Place the DRAINED status on an input IO when a stream is out of buffers and draining. All nodes that don't have HAVE_DATA on the input io need to copy it to the output io and return the status. This makes sure the DRAINED is forwarded and nodes return DRAINED from _process() DRAINED on the resampler flushes out the last queued samples and then forwards the DRAINED in the next iteration. Emit a new drained signal from the context when a node returns DRAINED. Use this to trigger the drained signal in the stream.
This commit is contained in:
parent
029f431418
commit
b18dacde9a
10 changed files with 46 additions and 42 deletions
|
|
@ -864,15 +864,13 @@ static int impl_node_process(void *object)
|
|||
|
||||
if (SPA_UNLIKELY(outio->status == SPA_STATUS_HAVE_DATA))
|
||||
return SPA_STATUS_HAVE_DATA;
|
||||
|
||||
if (SPA_UNLIKELY(inio->status != SPA_STATUS_HAVE_DATA))
|
||||
return SPA_STATUS_NEED_DATA;
|
||||
|
||||
/* recycle */
|
||||
if (SPA_LIKELY(outio->buffer_id < outport->n_buffers)) {
|
||||
recycle_buffer(this, outio->buffer_id);
|
||||
outio->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
if (SPA_UNLIKELY(inio->status != SPA_STATUS_HAVE_DATA))
|
||||
return outio->status = inio->status;
|
||||
|
||||
if (SPA_UNLIKELY(inio->buffer_id >= inport->n_buffers))
|
||||
return inio->status = -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue