summaryrefslogtreecommitdiff
path: root/sys/decklink
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2016-05-11 16:42:35 +0200
committerEdward Hervey <bilboed@bilboed.com>2016-05-11 16:52:44 +0200
commit41283361fac011132022bfb299e42fcfc29564aa (patch)
tree29fc7c94aa16e5e7c8f0780987a88d99f0149d05 /sys/decklink
parentd7b7d9deb77af60fcde26c56107e530c247846fe (diff)
downloadgstreamer-plugins-bad-41283361fac011132022bfb299e42fcfc29564aa.tar.gz
decklinkvideosrc: Fix previous commit
The frames queue might return nothing (be empty) if we're flushing. Move the assertion to after the flushing check
Diffstat (limited to 'sys/decklink')
-rw-r--r--sys/decklink/gstdecklinkvideosrc.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/decklink/gstdecklinkvideosrc.cpp b/sys/decklink/gstdecklinkvideosrc.cpp
index a795f204c..15ea0c85f 100644
--- a/sys/decklink/gstdecklinkvideosrc.cpp
+++ b/sys/decklink/gstdecklinkvideosrc.cpp
@@ -550,14 +550,16 @@ gst_decklink_video_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
f = (CaptureFrame *) g_queue_pop_head (&self->current_frames);
g_mutex_unlock (&self->lock);
- g_assert (f != NULL);
-
if (self->flushing) {
- capture_frame_free (f);
+ if (f)
+ capture_frame_free (f);
GST_DEBUG_OBJECT (self, "Flushing");
return GST_FLOW_FLUSHING;
}
+ // If we're not flushing, we should have a valid frame from the queue
+ g_assert (f != NULL);
+
g_mutex_lock (&self->lock);
if (self->caps_mode != f->mode) {
if (self->mode == GST_DECKLINK_MODE_AUTO) {