diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-01-14 16:33:53 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-01-14 16:33:53 +0100 |
commit | 5a12b2670e9de2858fabe410e65190d11537e7dc (patch) | |
tree | e6f68dbbd1e818b962f20f8dae5d3cb6dff2eed9 /sys/decklink | |
parent | 92fa187d11943a1a3f5387ea0b8b5f5fbabd6ea1 (diff) | |
download | gstreamer-plugins-bad-5a12b2670e9de2858fabe410e65190d11537e7dc.tar.gz |
decklinkvideosink: Stop scheduled playback shortly in PAUSED->PLAYING if it was running already
This fixes handling of flushing seeks, where we will get a PAUSED->PLAYING
state transition after the previous one without actually going to PAUSED
first.
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklinkvideosink.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp index d9b77ef27..72d0797e8 100644 --- a/sys/decklink/gstdecklinkvideosink.cpp +++ b/sys/decklink/gstdecklinkvideosink.cpp @@ -539,7 +539,6 @@ gst_decklink_video_sink_change_state (GstElement * element, GstDecklinkVideoSink *self = GST_DECKLINK_VIDEO_SINK_CAST (element); GstStateChangeReturn ret; - switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: gst_element_post_message (element, @@ -614,6 +613,7 @@ gst_decklink_video_sink_change_state (GstElement * element, case GST_STATE_CHANGE_PAUSED_TO_PLAYING:{ GstClockTime start_time; HRESULT res; + bool active; // FIXME: start time is the same for the complete pipeline, // but what we need here is the start time of this element! @@ -638,6 +638,20 @@ gst_decklink_video_sink_change_state (GstElement * element, convert_to_internal_clock (self, &start_time, NULL); + active = false; + self->output->output->IsScheduledPlaybackRunning (&active); + if (active) { + GST_DEBUG_OBJECT (self, "Stopping scheduled playback"); + + res = self->output->output->StopScheduledPlayback (0, 0, 0); + if (res != S_OK) { + GST_ELEMENT_ERROR (self, STREAM, FAILED, + (NULL), ("Failed to stop scheduled playback: 0x%08x", res)); + ret = GST_STATE_CHANGE_FAILURE; + break; + } + } + GST_DEBUG_OBJECT (self, "Starting scheduled playback at %" GST_TIME_FORMAT, GST_TIME_ARGS (start_time)); |