From 411795560f809b7954347ed57b2f3b38dcfcea04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 12 Nov 2014 13:58:56 +0100 Subject: [PATCH] intervideosrc: Stop showing the current frame after 1 second, not after 30 frames --- gst/inter/gstintervideosrc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/inter/gstintervideosrc.c b/gst/inter/gstintervideosrc.c index 2a64f267ff..8c24b0760a 100644 --- a/gst/inter/gstintervideosrc.c +++ b/gst/inter/gstintervideosrc.c @@ -337,6 +337,11 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size, } } if (intervideosrc->surface->video_buffer) { + gint fps = + 0.5 + + ((gdouble) GST_VIDEO_INFO_FPS_N (&intervideosrc->info)) / + ((gdouble) GST_VIDEO_INFO_FPS_D (&intervideosrc->info)); + buffer = gst_buffer_ref (intervideosrc->surface->video_buffer); /* Repeated buffer? */ @@ -344,10 +349,10 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size, is_gap = TRUE; intervideosrc->surface->video_buffer_count++; - if (intervideosrc->surface->video_buffer_count >= 30) { + if (intervideosrc->surface->video_buffer_count >= fps) { /* The first black buffer is not a GAP anymore but * the following are */ - if (intervideosrc->surface->video_buffer_count == 30) + if (intervideosrc->surface->video_buffer_count == fps) is_gap = FALSE; gst_buffer_unref (intervideosrc->surface->video_buffer);