mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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
This commit is contained in:
parent
962ca01596
commit
4ca76e0c12
1 changed files with 16 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue