summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2021-08-05 13:02:00 +0300
committerSebastian Dröge <sebastian@centricular.com>2021-08-05 13:03:12 +0300
commit743387052856352c9baa66b6c5c197e3ec5f452b (patch)
tree34a2e145a22387025613011d4c35c31bfb275cda /gst
parentc7be05cc38d283b2e31e1881222ede5387100aed (diff)
downloadgstreamer-plugins-bad-743387052856352c9baa66b6c5c197e3ec5f452b.tar.gz
timecodestamper: Fix latency calculation
The LTC extra latency is in ms already and not in frames, so multiplying with the framerate will end up with a wrong number. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2453>
Diffstat (limited to 'gst')
-rw-r--r--gst/timecode/gsttimecodestamper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/timecode/gsttimecodestamper.c b/gst/timecode/gsttimecodestamper.c
index 9a91b3927..b4139d81e 100644
--- a/gst/timecode/gsttimecodestamper.c
+++ b/gst/timecode/gsttimecodestamper.c
@@ -1002,13 +1002,15 @@ gst_timecodestamper_query (GstBaseTransform * trans,
/* Introduce additional LTC for waiting for LTC timecodes. The
* LTC library introduces some as well as the encoding of the LTC
* signal. */
- latency = timecodestamper->ltc_extra_latency *
- gst_util_uint64_scale_int_ceil (GST_SECOND,
- timecodestamper->vinfo.fps_d, timecodestamper->vinfo.fps_n);
+ latency = timecodestamper->ltc_extra_latency;
min_latency += latency;
if (max_latency != GST_CLOCK_TIME_NONE)
max_latency += latency;
timecodestamper->latency = min_latency;
+ GST_DEBUG_OBJECT (timecodestamper,
+ "Reporting latency min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT
+ " ours %" GST_TIME_FORMAT, GST_TIME_ARGS (min_latency),
+ GST_TIME_ARGS (max_latency), GST_TIME_ARGS (latency));
gst_query_set_latency (query, live, min_latency, max_latency);
} else {
timecodestamper->latency = 0;