[iOS] don't get out of sync when interrupt/resume calls are not balanced
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Feb 2015 15:47:51 +0000 (15:47 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Feb 2015 15:47:51 +0000 (15:47 +0000)
commit41c42d475055db543c955700eb6b5c3f956fffcc
treed584da3687e93c9413205c5974bcbf310fc2cb40
parent554db6cd9c66efc5846ec6d791435074dd68a387
[iOS] don't get out of sync when interrupt/resume calls are not balanced
https://bugs.webkit.org/show_bug.cgi?id=141310

Reviewed by Jer Noble.

Source/WebCore:

No new tests, updated media/video-interruption-with-resume-allowing-play.html.

* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::beginInterruption): Count interruptions.
(WebCore::MediaSession::endInterruption): Ignore calls when m_interruptionCount is already zero.
* platform/audio/MediaSession.h:

LayoutTests:

* media/video-interruption-with-resume-allowing-play-expected.txt:
* media/video-interruption-with-resume-allowing-play.html: Updated to test unbalanced calls
    to begin/end interruption.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt
LayoutTests/media/video-interruption-with-resume-allowing-play.html
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/MediaSession.cpp
Source/WebCore/platform/audio/MediaSession.h