mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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.
This commit is contained in:
parent
75b808d072
commit
e53627c277
1 changed files with 7 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue