Skip to content
  • Havard Graff's avatar
    baseaudiosink: don't allow aligning behind the read-segment · 588ac0ae
    Havard Graff authored
    Given a large enough drift-tolerance, one could end up in a situation
    where one would keep aligning the written buffers behind the current
    read-segment position. The result for the reader would be complete
    silence, possible preceded by very choppy audio.
    
    By checking the available headroom, one can determine if there is
    room to do alignment, or if one should resort to a resync instead to get
    the pointers back on track.
    
    Also refactor the alignment-logic out of the render function for cleaner
    code.
    588ac0ae