summaryrefslogtreecommitdiff
path: root/gst/timecode
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-10-23 14:29:06 +0300
committerSebastian Dröge <sebastian@centricular.com>2019-10-23 16:48:26 +0300
commitb57687a772917d3cd6d72080b1492d83b0f360ce (patch)
tree45886762da73776bbb465e6d5ada965ddb28122a /gst/timecode
parentfaffeaf83946d94a263a5c096eb93160b957aa27 (diff)
downloadgstreamer-plugins-bad-b57687a772917d3cd6d72080b1492d83b0f360ce.tar.gz
timecodestamper: Don't initialize upstream timecode with zero if none was seen
Instead keep it unset and use the internal timecode wherever needed as fallback.
Diffstat (limited to 'gst/timecode')
-rw-r--r--gst/timecode/gsttimecodestamper.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gst/timecode/gsttimecodestamper.c b/gst/timecode/gsttimecodestamper.c
index 4d7a60705..c8bea0ff3 100644
--- a/gst/timecode/gsttimecodestamper.c
+++ b/gst/timecode/gsttimecodestamper.c
@@ -907,17 +907,14 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
if (timecodestamper->last_tc) {
gst_video_time_code_increment_frame (timecodestamper->last_tc);
+
+ tc_str = gst_video_time_code_to_string (timecodestamper->last_tc);
+ GST_DEBUG_OBJECT (timecodestamper, "Incremented upstream timecode to %s",
+ tc_str);
+ g_free (tc_str);
} else {
- /* We have no last known timecode so initialize with 0 here */
- timecodestamper->last_tc =
- gst_video_time_code_new (timecodestamper->vinfo.fps_n,
- timecodestamper->vinfo.fps_d, dt_frame, tc_flags, 0, 0, 0, 0, 0);
+ GST_DEBUG_OBJECT (timecodestamper, "Never saw an upstream timecode");
}
-
- tc_str = gst_video_time_code_to_string (timecodestamper->last_tc);
- GST_DEBUG_OBJECT (timecodestamper, "Incremented upstream timecode to %s",
- tc_str);
- g_free (tc_str);
}
/* Update RTC-based timecode */
@@ -1164,6 +1161,9 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
break;
case GST_TIME_CODE_STAMPER_SOURCE_LAST_KNOWN:
tc = timecodestamper->last_tc;
+ if (!tc)
+ tc = timecodestamper->internal_tc;
+ break;
break;
case GST_TIME_CODE_STAMPER_SOURCE_LTC:
#if HAVE_LTC