diff options
author | Edward Hervey <edward@centricular.com> | 2016-05-11 16:42:35 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2016-05-11 16:52:44 +0200 |
commit | 41283361fac011132022bfb299e42fcfc29564aa (patch) | |
tree | 29fc7c94aa16e5e7c8f0780987a88d99f0149d05 /sys/decklink | |
parent | d7b7d9deb77af60fcde26c56107e530c247846fe (diff) | |
download | gstreamer-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.cpp | 8 |
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) { |