Title: [170014] trunk/Source/WebCore
Revision
170014
Author
[email protected]
Date
2014-06-16 10:23:49 -0700 (Mon, 16 Jun 2014)

Log Message

[MSE][Mac] Occasional image corruption after seeking
https://bugs.webkit.org/show_bug.cgi?id=133879

Reviewed by Eric Carlson.

Change the order of operations for seeks: change the current time of the AVSampleBufferRenderSynchronizer
before flushing and appending non-displaying samples.

Rather than having a single function which retrieves the fast seek time and then seeks, split this out
into two functions: one which gets the fast seek time, and one which seeks. (The later of course already
exists: seekToTime()).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Renamed from seekToTime()
(WebCore::MediaSourcePrivateAVFObjC::seekToTime): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170013 => 170014)


--- trunk/Source/WebCore/ChangeLog	2014-06-16 16:45:59 UTC (rev 170013)
+++ trunk/Source/WebCore/ChangeLog	2014-06-16 17:23:49 UTC (rev 170014)
@@ -1,3 +1,25 @@
+2014-06-16  Jer Noble  <[email protected]>
+
+        [MSE][Mac] Occasional image corruption after seeking
+        https://bugs.webkit.org/show_bug.cgi?id=133879
+
+        Reviewed by Eric Carlson.
+
+        Change the order of operations for seeks: change the current time of the AVSampleBufferRenderSynchronizer
+        before flushing and appending non-displaying samples.
+
+        Rather than having a single function which retrieves the fast seek time and then seeks, split this out
+        into two functions: one which gets the fast seek time, and one which seeks. (The later of course already
+        exists: seekToTime()).
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+        (WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Renamed from seekToTime()
+        (WebCore::MediaSourcePrivateAVFObjC::seekToTime): Deleted.
+
 2014-06-16  Zan Dobersek  <[email protected]>
 
         Have ScriptExecutionContext::Task functions take in a ScriptExecutionContext reference

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (170013 => 170014)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2014-06-16 16:45:59 UTC (rev 170013)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2014-06-16 17:23:49 UTC (rev 170014)
@@ -436,13 +436,14 @@
     if (!m_mediaSourcePrivate)
         return;
 
-    MediaTime seekTime = MediaTime::createWithDouble(time);
+    MediaTime seekTime;
     if (!negativeThreshold && !positiveThreshold)
-        m_mediaSourcePrivate->seekToTime(seekTime);
+        seekTime = MediaTime::createWithDouble(time);
     else
-        seekTime = m_mediaSourcePrivate->seekToTime(seekTime, MediaTime::createWithDouble(positiveThreshold), MediaTime::createWithDouble(negativeThreshold));
+        seekTime = m_mediaSourcePrivate->fastSeekTimeForMediaTime(MediaTime::createWithDouble(time), MediaTime::createWithDouble(positiveThreshold), MediaTime::createWithDouble(negativeThreshold));
 
     [m_synchronizer setRate:(m_playing ? m_rate : 0) time:toCMTime(seekTime)];
+    m_mediaSourcePrivate->seekToTime(seekTime);
 }
 
 bool MediaPlayerPrivateMediaSourceAVFObjC::seeking() const

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (170013 => 170014)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2014-06-16 16:45:59 UTC (rev 170013)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2014-06-16 17:23:49 UTC (rev 170014)
@@ -68,7 +68,7 @@
     bool hasVideo() const;
 
     void seekToTime(MediaTime);
-    MediaTime seekToTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
+    MediaTime fastSeekTimeForMediaTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
     IntSize naturalSize() const;
 
 #if ENABLE(ENCRYPTED_MEDIA_V2)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (170013 => 170014)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm	2014-06-16 16:45:59 UTC (rev 170013)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm	2014-06-16 17:23:49 UTC (rev 170014)
@@ -184,7 +184,7 @@
         buffer->seekToTime(time);
 }
 
-MediaTime MediaSourcePrivateAVFObjC::seekToTime(MediaTime targetTime, MediaTime negativeThreshold, MediaTime positiveThreshold)
+MediaTime MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime targetTime, MediaTime negativeThreshold, MediaTime positiveThreshold)
 {
     MediaTime seekTime = targetTime;
 
@@ -194,8 +194,6 @@
             seekTime = sourceSeekTime;
     }
 
-    seekToTime(seekTime);
-
     return seekTime;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to