projects
/
platform
/
upstream
/
gst-plugins-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
910b2ca
)
timecode: Fix invalid drop-frame timecode right before a new second
author
Vivia Nikolaidou
<vivia@ahiru.eu>
Thu, 6 Apr 2017 19:38:34 +0000
(22:38 +0300)
committer
Sebastian Dröge
<sebastian@centricular.com>
Sun, 9 Apr 2017 08:15:27 +0000
(11:15 +0300)
The previous fix was only working for non-drop-frame timecodes.
https://bugzilla.gnome.org/show_bug.cgi?id=779866
gst-libs/gst/video/gstvideotimecode.c
patch
|
blob
|
history
diff --git
a/gst-libs/gst/video/gstvideotimecode.c
b/gst-libs/gst/video/gstvideotimecode.c
index
5c711ce
..
01026f8
100644
(file)
--- a/
gst-libs/gst/video/gstvideotimecode.c
+++ b/
gst-libs/gst/video/gstvideotimecode.c
@@
-229,7
+229,8
@@
gst_video_time_code_init_from_date_time (GstVideoTimeCode * tc,
frames =
gst_util_uint64_scale_round (g_date_time_get_microsecond (dt) *
G_GINT64_CONSTANT (1000), fps_n, fps_d * GST_SECOND);
- if (G_UNLIKELY (frames == fps_n)) {
+ if (G_UNLIKELY (((frames == fps_n) && (fps_d == 1)) ||
+ ((frames == fps_n / 1000) && (fps_d == 1001)))) {
/* Avoid invalid timecodes */
frames--;
add_a_frame = TRUE;