Fix the issue that audio is not played after resuming.
authoreojin.ham <eojin.ham@samsung.com>
Tue, 16 Jul 2013 11:40:15 +0000 (20:40 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 17 Jul 2013 14:49:06 +0000 (14:49 +0000)
[Title] Fix the issue that audio is not played after resuming.
[Problem] N_SE_46100
          After 'DeviceMotionCapture' app is resumed, sound effect is not played.
[Cause] Seeking to end position when resuming.
[Solution] Fix not to seek end of position when the media already reach end of file.

Change-Id: I9b7741f0bcfce7e31351ef11602bfb7f16757aa7

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

index e8a601e..07f6508 100755 (executable)
@@ -1097,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);