Fix the issue that audio is not played after resuming.
[framework/web/webkit-efl.git] / Source / WebCore / platform / graphics / gstreamer / MediaPlayerPrivateGStreamer.cpp
index b23a085..07f6508 100755 (executable)
@@ -470,7 +470,10 @@ void MediaPlayerPrivateGStreamer::load(const String& url)
     // Set m_videoSize as frame size which comes from webkitCameraSource.
     // This size is fixed.
     if (isLocalMediaStream())
-        m_videoSize = IntSize(480, 640);
+        if (gst_element_factory_find("camerasrc"))
+            m_videoSize = IntSize(480, 640);
+        else
+            m_videoSize = IntSize(640, 480);
 #endif
 
     if (m_preload == MediaPlayer::None) {
@@ -713,7 +716,8 @@ void MediaPlayerPrivateGStreamer::seek(float time)
         m_seeking = true;
         m_seekTime = time;
 #if ENABLE(TIZEN_GSTREAMER_VIDEO)
-        m_isEndReached = false;
+        if (m_seekTime != m_mediaDuration)
+            m_isEndReached = false;
 #endif
     }
 }
@@ -1093,8 +1097,9 @@ gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
             GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_playBin.get()), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.data());
 
 #if ENABLE(TIZEN_GSTREAMER_VIDEO)
-            if (m_suspendTime > 0 && newState == GST_STATE_PAUSED) {
-                if (!isLocalMediaStream())
+            HTMLMediaElement* element = static_cast<HTMLMediaElement*>(player()->mediaPlayerClient());
+            if (element->suspended() && newState == GST_STATE_PAUSED) {
+                if (m_suspendTime > 0 && !(isLocalMediaStream() || m_isEndReached))
                     seek(m_suspendTime);
                 m_suspendTime = 0;
                 m_player->mediaPlayerClient()->setSuspended(false);
@@ -1736,7 +1741,11 @@ void MediaPlayerPrivateGStreamer::didEnd()
     // HTMLMediaElement. In some cases like reverse playback the
     // position is not always reported as 0 for instance.
     float now = currentTime();
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+    if (now > 0 && now != duration()) {
+#else
     if (now > 0 && now <= duration() && m_mediaDuration != now) {
+#endif
         m_mediaDurationKnown = true;
         m_mediaDuration = now;
         m_player->durationChanged();
@@ -2010,7 +2019,9 @@ static HashSet<String> mimeTypeCache()
         "video/ogg",
         "video/quicktime",
         "video/vivo",
+#if !ENABLE(TIZEN_GSTREAMER_VIDEO)
         "video/webm",
+#endif
         "video/x-cdxa",
         "video/x-dirac",
         "video/x-dv",