mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
timecodestamper: Skip over invalid LTC timecodes immediately
This commit is contained in:
parent
a1443518e0
commit
a4c925f694
1 changed files with 15 additions and 12 deletions
|
@ -1306,6 +1306,16 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
|||
g_queue_get_length (&timecodestamper->ltc_current_tcs));
|
||||
g_free (tc_str);
|
||||
|
||||
if (!gst_video_time_code_is_valid (<c_tc->timecode)) {
|
||||
tc_str = gst_video_time_code_to_string (<c_tc->timecode);
|
||||
GST_INFO_OBJECT (timecodestamper, "Invalid LTC timecode %s", tc_str);
|
||||
g_free (tc_str);
|
||||
gst_video_time_code_clear (<c_tc->timecode);
|
||||
g_free (ltc_tc);
|
||||
ltc_tc = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* A timecode frame that starts +/- half a frame to the
|
||||
* video frame is considered belonging to that video frame.
|
||||
*
|
||||
|
@ -1319,18 +1329,11 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
|
|||
if (timecodestamper->ltc_auto_resync) {
|
||||
if (timecodestamper->ltc_internal_tc)
|
||||
gst_video_time_code_free (timecodestamper->ltc_internal_tc);
|
||||
if (gst_video_time_code_is_valid (<c_tc->timecode)) {
|
||||
timecodestamper->ltc_internal_tc =
|
||||
gst_video_time_code_copy (<c_tc->timecode);
|
||||
timecodestamper->ltc_internal_running_time = ltc_tc->running_time;
|
||||
updated_internal = TRUE;
|
||||
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
||||
} else {
|
||||
tc_str = gst_video_time_code_to_string (<c_tc->timecode);
|
||||
GST_INFO_OBJECT (timecodestamper, "Invalid LTC timecode %s",
|
||||
tc_str);
|
||||
g_free (tc_str);
|
||||
}
|
||||
timecodestamper->ltc_internal_tc =
|
||||
gst_video_time_code_copy (<c_tc->timecode);
|
||||
timecodestamper->ltc_internal_running_time = ltc_tc->running_time;
|
||||
updated_internal = TRUE;
|
||||
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
||||
}
|
||||
|
||||
/* And store it back for the next frame in case it has more or less
|
||||
|
|
Loading…
Reference in a new issue