Skip to content

livesync improvements

  • livesync: Rename activatemode methods to *_activatemode
    This matches the other plugins.

  • livesync: Simplify start_src_task and src_loop
    This should effect no change in behavior.

  • livesync: Improve audio duration fixups

    • An entirely missing duration is now only logged at debug level instead of pretending the duration was zero and warning about it.
    • Silently fix up a duration difference up to one sample.
    • Error when we fail to calculate the duration; don't try to apply the fallback_duration to a non-video stream.
  • livesync: Log a category error when we are missing the segment

  • livesync: Clean up state handling

    • Separate resetting state more cleanly, introducing set_flushing, sink_reset and src_reset.
    • Clear the queue early when we flush, in order to unblock waits on query responses.
    • Return an error when we fail to start, pause or stop the task.
  • livesync: Replace an if-let with match
    No change in behavior, yet. Separate commit to ease reviewing.

  • livesync: Move a notify closer to the interesting state change
    Move the notify_all to where we pop the buffer. We're moving within a single state lock so no change in behavior.

  • livesync: Move num_in counting to the src task
    This is in preparation for moving more accept/discard logic to the src task, so we can only count num_in here.

  • livesync: Simplify num_duplicate counting

  • livesync: Handle flags and late buffer patching after queueing
    This makes the chain function almost independent of the output state. We still do the early discard check with buffer_is_backwards so we don't try to queue buffers we can't use, allowing us to fast-forward upstream without blocking on the src task.

    Don't accept LateOverThreshold buffers when we have pending_caps or a pending_segment. We need to apply these first before we can sensibly patch buffers from the new stream.

    Deduplicate most of the output buffer patching code into a new patch_output_buffer method.

    For: #450 (closed)

  • livesync: Separate out_buffer duplicate status from GAP flag
    Otherwise we might get confused by upstream GAP buffers.

  • livesync: Use fallback_duration for audio repeat buffers as well
    Don't depend on upstream giving us sanely-sized buffers if we want to repeat.

  • livesync: example: Add identitys single-segment=1
    These let us change the runtime offset of the test buffers via pad offsets without pushing new segments into livesync, which is necessary to demo the late-threshold behavior.

Edited by Jan Alexander Steffens

Merge request reports