void MediaPlayerPrivateGStreamer::cacheDuration()
{
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+ float previousDuration = m_mediaDuration;
+#endif
// Reset cached media duration
m_mediaDuration = 0;
gst_element_get_state(m_playBin.get(), &state, 0, 0);
float newDuration = duration();
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+ if (state > GST_STATE_READY) {
+ // Don't set m_mediaDurationKnown yet if the pipeline is not
+ // paused. This allows duration() query to fail at least once
+ // before playback starts and duration becomes known.
+ m_mediaDurationKnown = !isinf(newDuration);
+ }
+
+ if (!isinf(newDuration))
+ m_mediaDuration = newDuration;
+ else
+ m_mediaDuration = previousDuration;
+#else
if (state <= GST_STATE_READY) {
// Don't set m_mediaDurationKnown yet if the pipeline is not
// paused. This allows duration() query to fail at least once
if (!isinf(newDuration))
m_mediaDuration = newDuration;
+#endif
}
void MediaPlayerPrivateGStreamer::durationChanged()