diff options
author | Todd Agulnick <todd@agulnick.com> | 2013-12-14 18:12:53 -0500 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2013-12-15 10:15:31 +0100 |
commit | 44b94295161c2433b7f45ac882bc6c85b4c518de (patch) | |
tree | a9e514d745038730ceef6a98f904bd0b1e5f2bbd /sys/decklink | |
parent | d5eccb22855ff1a84ac587ff54821c388f9f0fc8 (diff) | |
download | gstreamer-plugins-bad-44b94295161c2433b7f45ac882bc6c85b4c518de.tar.gz |
decklinksrc: Process EOS even when there are no incoming video frames.
https://bugzilla.gnome.org/show_bug.cgi?id=680700
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklinksrc.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/decklink/gstdecklinksrc.cpp b/sys/decklink/gstdecklinksrc.cpp index 6e9e6404a..7c2683afb 100644 --- a/sys/decklink/gstdecklinksrc.cpp +++ b/sys/decklink/gstdecklinksrc.cpp @@ -362,6 +362,7 @@ gst_decklink_src_send_event (GstElement * element, GstEvent * event) case GST_EVENT_EOS: g_atomic_int_set (&src->pending_eos, TRUE); GST_INFO_OBJECT (src, "EOS pending"); + g_cond_signal (&src->cond); result = TRUE; break; break; @@ -745,7 +746,8 @@ gst_decklink_src_task (void *priv) GST_DEBUG_OBJECT (decklinksrc, "task"); g_mutex_lock (&decklinksrc->mutex); - while (decklinksrc->video_frame == NULL && !decklinksrc->stop) { + while (decklinksrc->video_frame == NULL && !decklinksrc->stop && + !decklinksrc->pending_eos) { g_cond_wait (&decklinksrc->cond, &decklinksrc->mutex); } video_frame = decklinksrc->video_frame; @@ -763,6 +765,13 @@ gst_decklink_src_task (void *priv) return; } + if (g_atomic_int_compare_and_exchange (&decklinksrc->pending_eos, TRUE, + FALSE)) { + GST_INFO_OBJECT (decklinksrc, "EOS pending"); + flow = GST_FLOW_EOS; + goto pause; + } + /* warning on dropped frames */ /* FIXME: post QoS message */ if (decklinksrc->dropped_frames - decklinksrc->dropped_frames_old > 0) { @@ -887,12 +896,6 @@ gst_decklink_src_task (void *priv) else flow = video_flow; - if (g_atomic_int_compare_and_exchange (&decklinksrc->pending_eos, TRUE, - FALSE)) { - GST_INFO_OBJECT (decklinksrc, "EOS pending"); - flow = GST_FLOW_EOS; - } - if (flow != GST_FLOW_OK) goto pause; |