mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
timecodestamper: Validate LTC timestamps before trying to use them
There's no point in working with invalid LTC timestamps as all future calculations will be wrong based on this, and invalid LTC timestamps can sometimes be read via the audio input.
This commit is contained in:
parent
e5585b1bde
commit
aafda1c76f
1 changed files with 11 additions and 4 deletions
|
@ -1089,10 +1089,17 @@ 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);
|
||||
timecodestamper->ltc_internal_tc =
|
||||
gst_video_time_code_copy (ltc_read_tc_ptr);
|
||||
updated_internal = TRUE;
|
||||
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
||||
if (gst_video_time_code_is_valid (ltc_read_tc_ptr)) {
|
||||
timecodestamper->ltc_internal_tc =
|
||||
gst_video_time_code_copy (ltc_read_tc_ptr);
|
||||
updated_internal = TRUE;
|
||||
GST_INFO_OBJECT (timecodestamper, "Resynced internal LTC counter");
|
||||
} else {
|
||||
tc_str = gst_video_time_code_to_string (ltc_read_tc_ptr);
|
||||
GST_INFO_OBJECT (timecodestamper, "Invalid LTC timecode %s",
|
||||
tc_str);
|
||||
g_free (tc_str);
|
||||
}
|
||||
}
|
||||
|
||||
/* And store it for the next frame in case it has more or less the
|
||||
|
|
Loading…
Reference in a new issue