Skip to content
  • Sebastian Dröge's avatar
    interlace: Increment phase_index before checking if we're at the end of the phase · 9fb5c5f4
    Sebastian Dröge authored and Tim-Philipp Müller's avatar Tim-Philipp Müller committed
    Incrementing it afterwards will always have to phase_index >= 1 and we
    will never be at the beginning (0) of the phase again, and thus never
    reset timestamp tracking accordingly.
    
    This was broken in bea13ef4 in 2010, and
    causes interlace to run into integer overflows after 2^31 frames or
    about 5 hours at 29.97fps. Due to usage of wrong types for the integers
    this then causes negative numbers to be used in calculations and all
    calculations spectacularly fail, leading to all following buffers to
    have the timestamp of the first buffer minus one nanosecond.
    9fb5c5f4