summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2018-08-28 15:04:53 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2018-08-28 15:23:48 +0300
commit4ca76e0c123b37175dd76057dbb45c96b47e7477 (patch)
tree57a15ae340825b3c143e475cadb13768ddc2d633
parent962ca015966967816b97befaf7518b63e6e9edc2 (diff)
decklink: Only use drop-frame flag for 29.97 and 59.94 FPS
Otherwise it can cause errors in gstvideotimecode.c because drop-frame is not defined for any other frame rate (e.g. 24000/101) https://blog.frame.io/2017/07/17/timecode-and-frame-rates/ https://bugzilla.gnome.org/show_bug.cgi?id=797037
-rw-r--r--sys/decklink/gstdecklinkvideosrc.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/decklink/gstdecklinkvideosrc.cpp b/sys/decklink/gstdecklinkvideosrc.cpp
index d2c784d17..deda24a8b 100644
--- a/sys/decklink/gstdecklinkvideosrc.cpp
+++ b/sys/decklink/gstdecklinkvideosrc.cpp
@@ -758,10 +758,22 @@ gst_decklink_video_src_got_frame (GstElement * element,
flags =
(GstVideoTimeCodeFlags) (flags |
GST_VIDEO_TIME_CODE_FLAGS_INTERLACED);
- if (bmode->fps_d == 1001 && (bmode->fps_n == 30000 || bmode->fps_n == 60000))
- flags =
- (GstVideoTimeCodeFlags) (flags |
- GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME);
+ if (bmode->fps_d == 1001) {
+ if (bmode->fps_n == 30000 || bmode->fps_n == 60000) {
+ /* Some occurrences have been spotted where the driver mistakenly
+ * fails to set the drop-frame flag for drop-frame timecodes.
+ * Assume always drop-frame for 29.97 and 59.94 FPS */
+ flags =
+ (GstVideoTimeCodeFlags) (flags |
+ GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME);
+ } else {
+ /* Drop-frame isn't defined for any other framerates (e.g. 23.976)
+ * */
+ flags =
+ (GstVideoTimeCodeFlags) (flags &
+ ~GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME);
+ }
+ }
f.tc =
gst_video_time_code_new (bmode->fps_n, bmode->fps_d, NULL, flags,
hours, minutes, seconds, frames, field_count);