summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Salveti de Araujo <rsalveti@rsalveti.net>2015-08-06 18:29:28 -0300
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-08-18 09:49:09 +0000
commite0b9217d27509ded76daf6b18e1ed4c0fab280c7 (patch)
treec42621c50fb50692703e662cbc6cda0047941724
parentc9533b5aaf4347875b8296cb6210279af9781f8a (diff)
downloadqtmultimedia-e0b9217d27509ded76daf6b18e1ed4c0fab280c7.tar.gz
qtmultimedia-e0b9217d27509ded76daf6b18e1ed4c0fab280c7.tar.bz2
qtmultimedia-e0b9217d27509ded76daf6b18e1ed4c0fab280c7.zip
Avoid races when sending EOS
In order to avoid races when sending EOS, we need to make sure that the pipeline is in playing state first. Task-number: QTBUG-45707 Change-Id: I518e89badf38bea8ab8e2cead9a1ca09659af8b2 Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
index 3238e5c2..77d8987f 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp
@@ -776,11 +776,11 @@ void QGstreamerCaptureSession::setState(QGstreamerCaptureSession::State newState
if (!m_waitingForEos) {
m_waitingForEos = true;
//qDebug() << "Waiting for EOS";
+ // Unless gstreamer is in GST_STATE_PLAYING our EOS message will not be received.
+ gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
//with live sources it's necessary to send EOS even to pipeline
//before going to STOPPED state
gst_element_send_event(m_pipeline, gst_event_new_eos());
- // Unless gstreamer is in GST_STATE_PLAYING our EOS message will not be received.
- gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
return;
} else {