timecodestamper: Refactor LTC audio waiting and properly handle live inputs
authorSebastian Dröge <sebastian@centricular.com>
Fri, 27 Dec 2019 14:56:32 +0000 (16:56 +0200)
committerSebastian Dröge <slomo@coaxion.net>
Mon, 30 Dec 2019 09:36:23 +0000 (09:36 +0000)
commit0dc783d719c2301fece72e230f29bb2f86e38dcd
tree39b9947e3c0d679f42e139be3b995a5832d8b5df
parent85233eb9681728cd214e231aea0337f1487ad153
timecodestamper: Refactor LTC audio waiting and properly handle live inputs

If one of the inputs is live, add a latency of 2 frames to the video
stream and wait on the clock for that much time to pass to allow for the
LTC audio to be ahead.

In case of live LTC, don't do any waiting but only ensure that we don't
overflow the LTC queue.

Also in non-live LTC audio mode, flush too old items from the LTC queue
if the video is actually ahead instead of potentially waiting forever.
This could've happened if there was a bigger gap in the video stream.
gst/timecode/gsttimecodestamper.c
gst/timecode/gsttimecodestamper.h