summaryrefslogtreecommitdiff
path: root/gst/inter
diff options
context:
space:
mode:
authorArun Raghavan <arun@centricular.com>2015-01-23 12:28:42 +0530
committerArun Raghavan <git@arunraghavan.net>2015-01-23 12:47:03 +0530
commite53627c277434cebd085d72b5d6824420780afca (patch)
treebb571e993416cb89dafd9b5810680adc66f2b34c /gst/inter
parent75b808d07235b9cd9ed0dbdacdad792be27ff2e4 (diff)
downloadgstreamer-plugins-bad-e53627c277434cebd085d72b5d6824420780afca.tar.gz
intervideosrc: Fix GAP flag setting on non-black frames
The previous commit fixed setting the GAP flag on black frames, but incorrectly dropped the flag on repeated pushes of the same video buffer.
Diffstat (limited to 'gst/inter')
-rw-r--r--gst/inter/gstintervideosrc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gst/inter/gstintervideosrc.c b/gst/inter/gstintervideosrc.c
index b13656e00..6553ed1ef 100644
--- a/gst/inter/gstintervideosrc.c
+++ b/gst/inter/gstintervideosrc.c
@@ -363,21 +363,21 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size,
if (intervideosrc->surface->video_buffer) {
/* We have a buffer to push */
buffer = gst_buffer_ref (intervideosrc->surface->video_buffer);
- intervideosrc->surface->video_buffer_count++;
/* Can only be true if timeout > 0 */
- if (intervideosrc->surface->video_buffer_count >= frames) {
+ if (intervideosrc->surface->video_buffer_count == frames) {
gst_buffer_unref (intervideosrc->surface->video_buffer);
intervideosrc->surface->video_buffer = NULL;
}
- } else if (intervideosrc->surface->video_buffer_count == frames) {
- /* This will be our first black frame */
- intervideosrc->surface->video_buffer_count++;
- } else if (intervideosrc->surface->video_buffer_count > frames) {
- /* The first black buffer is not a GAP, but the following ones are */
+ }
+
+ if (intervideosrc->surface->video_buffer_count != 0 &&
+ intervideosrc->surface->video_buffer_count != (frames + 1)) {
+ /* This is a repeat of the stored buffer or of a black frame */
is_gap = TRUE;
}
+ intervideosrc->surface->video_buffer_count++;
g_mutex_unlock (&intervideosrc->surface->mutex);
if (caps) {