Fix issue that timeline goes back to 00:00 during pressing FF button repeatly
authorJiyeon Kim <jiyeon0402.kim@samsung.com>
Fri, 10 May 2013 04:01:24 +0000 (13:01 +0900)
committerJiyeon Kim <jiyeon0402.kim@samsung.com>
Fri, 10 May 2013 04:26:22 +0000 (13:26 +0900)
[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

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index d8b2a89..050cbc0 100755 (executable)
@@ -510,6 +510,10 @@ void MediaPlayerPrivateGStreamer::commitLoad()
 
 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
@@ -527,7 +531,11 @@ float MediaPlayerPrivateGStreamer::playbackPosition() const
     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
         return ret;
+#endif
     }
 
     gint64 position;
@@ -538,6 +546,9 @@ float MediaPlayerPrivateGStreamer::playbackPosition() const
     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);