[MSE][Mac] Pause playback when readyState drops below HAVE_FUTURE_DATA, and do not...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jun 2014 21:32:49 +0000 (21:32 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jun 2014 21:32:49 +0000 (21:32 +0000)
commit77313c2ceb639486afde1c8fbf957a33ce74377e
treec92da867252d72c063d4f579802532fe513fbf4e
parent0c5ee057e4f5a66c38001925838d7746423c3575
[MSE][Mac] Pause playback when readyState drops below HAVE_FUTURE_DATA, and do not complete seek until it rises above HAVE_METADATA.
https://bugs.webkit.org/show_bug.cgi?id=134306

Reviewed by Eric Carlson.

Pause the synchronizer before seeking, and do not resume the synchronizer until it both reports that the seek completed,
and that the readyState rises above HAVE_METADATA. In every other location where we change the rate of the synchronizer,
gate that rate change on the above.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Check shouldBePlaying().
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): Unset m_seekCompleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Pause the synchronizer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble): Check shouldBePlaying().
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying): Test m_seeking, !m_seekCompleted, and the readyState.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): Set m_seekCompleted; check shouldBePlaying() and play if appropriate.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm