summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2024-04-25 10:26:45 +0800
committerTim Blechmann <tim@klingt.org>2024-04-26 13:53:23 +0800
commit99a7883607b4fe1fd8afaebe6ea87be5f4a36f2d (patch)
tree4b419ed774b112f78a5e64d5f44a07f68ad9206a
parentb30c39c90928cf8205478919847737a2ae60345d (diff)
GStreamer: QGstreamerMediaEncoder - fix duration updates
`QGstreamerMediaEncoder` has a timer to update the duration. This timer is stopped when `pause` or `stop`. We should update the duration in this case to cope with the duration that may have expired since the last update. Task-number: QTBUG-124183 Pick-to: 6.5 6.7 Change-Id: Ia8b0df7a1e19917b137260069eba1c053188c2b0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
-rw-r--r--src/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaencoder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaencoder.cpp b/src/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaencoder.cpp
index 218026ede..11aeca455 100644
--- a/src/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaencoder.cpp
+++ b/src/plugins/multimedia/gstreamer/mediacapture/qgstreamermediaencoder.cpp
@@ -340,6 +340,7 @@ void QGstreamerMediaEncoder::pause()
if (!m_session || m_finalizing || state() != QMediaRecorder::RecordingState)
return;
signalDurationChangedTimer.stop();
+ durationChanged(duration());
gstPipeline.dumpGraph("before-pause");
stateChanged(QMediaRecorder::PausedState);
}
@@ -357,6 +358,7 @@ void QGstreamerMediaEncoder::stop()
{
if (!m_session || m_finalizing || state() == QMediaRecorder::StoppedState)
return;
+ durationChanged(duration());
qCDebug(qLcMediaEncoderGst) << "stop";
m_finalizing = true;
m_session->unlinkEncoder();