tdf#40780 extend default media duration from 0.01s to 0.3s.
Player can only update the duration when the state of the
GStreamer pipeline changes. But GStreamer need some time to get
ready. However the default duration (0.01s) is so short that
the audio node is deactivated before the duration update.
Hence I just pick up a value that is long enough to allow
update happen empirically.
Change-Id: If94133fde09e414bd9ea3c4b162a13d5c70f4524
Reviewed-on: https://gerrit.libreoffice.org/67783
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
index 46432c7..a81c386 100644
--- a/avmedia/source/gstreamer/gstplayer.cxx
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -735,7 +735,7 @@ double SAL_CALL Player::getDuration()
::osl::MutexGuard aGuard(m_aMutex);
// slideshow checks for non-zero duration, so cheat here
double duration = 0.01;
double duration = 0.3;
if( mpPlaybin && mnDuration > 0 ) {
duration = mnDuration / GST_SECOND;