[Title] Fix issue that timeline goes back to 00:00 during pressing FF button repeatly
[Problem] N_SE-38067
[Cause] playbackPosition() method return 0.0f when error occured
[Solution] Keep cached time value in playbackPosition method and return cached time value when error occured
Change-Id: Ia2ea72dbf744f125dcad5d4e66ecd4542b6e4ee7
float MediaPlayerPrivateGStreamer::playbackPosition() const
{
float MediaPlayerPrivateGStreamer::playbackPosition() const
{
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+ static float cachedTime;
+#endif
+
if (m_isEndReached) {
// Position queries on a null pipeline return 0. If we're at
// the end of the stream the pipeline is null but we want to
if (m_isEndReached) {
// Position queries on a null pipeline return 0. If we're at
// the end of the stream the pipeline is null but we want to
if (!gst_element_query(m_playBin.get(), query)) {
LOG_MEDIA_MESSAGE("Position query failed...");
gst_query_unref(query);
if (!gst_element_query(m_playBin.get(), query)) {
LOG_MEDIA_MESSAGE("Position query failed...");
gst_query_unref(query);
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+ return cachedTime;
+#else
if (position != static_cast<gint64>(GST_CLOCK_TIME_NONE))
ret = static_cast<double>(position) / GST_SECOND;
if (position != static_cast<gint64>(GST_CLOCK_TIME_NONE))
ret = static_cast<double>(position) / GST_SECOND;
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+ cachedTime = ret;
+#endif
LOG_MEDIA_MESSAGE("Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
gst_query_unref(query);
LOG_MEDIA_MESSAGE("Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
gst_query_unref(query);