Changeset 179869 in webkit
- Timestamp:
- Feb 10, 2015, 7:47:51 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt (modified) (1 diff)
-
LayoutTests/media/video-interruption-with-resume-allowing-play.html (modified) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/audio/MediaSession.cpp (modified) (2 diffs)
-
Source/WebCore/platform/audio/MediaSession.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r179868 r179869 1 2015-02-10 Eric Carlson <eric.carlson@apple.com> 2 3 [iOS] don't get out of sync when interrupt/resume calls are not balanced 4 https://bugs.webkit.org/show_bug.cgi?id=141310 5 6 Reviewed by Jer Noble. 7 8 * media/video-interruption-with-resume-allowing-play-expected.txt: 9 * media/video-interruption-with-resume-allowing-play.html: Updated to test unbalanced calls 10 to begin/end interruption. 11 1 12 2015-02-10 Marcos Chavarría Teijeiro <chavarria1991@gmail.com> 2 13 -
trunk/LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt
r163390 r179869 16 16 EXPECTED (video.paused == 'false') OK 17 17 18 EXPECTED (video.paused == 'false') OK 19 RUN(internals.beginMediaSessionInterruption()) 20 21 100ms timer fired... 22 EXPECTED (video.paused == 'true') OK 23 RUN(internals.endMediaSessionInterruption('MayResumePlaying')) 24 25 EVENT(playing) 26 EXPECTED (video.paused == 'false') OK 27 18 28 END OF TEST 19 29 -
trunk/LayoutTests/media/video-interruption-with-resume-allowing-play.html
r163390 r179869 5 5 <script> 6 6 var state = 0; 7 var resumeCount = 0; 7 8 8 9 function checkState() … … 16 17 consoleWrite(""); 17 18 break; 19 18 20 case "interrupted": 19 21 consoleWrite("100ms timer fired..."); … … 23 25 consoleWrite(""); 24 26 break; 27 25 28 case "resuming": 26 29 testExpected("video.paused", false); 27 30 consoleWrite(""); 28 endTest(); 31 if (++resumeCount == 2) 32 endTest(); 33 state = "playing"; 34 setTimeout(checkState, 100); 29 35 break; 30 36 } -
trunk/Source/WebCore/ChangeLog
r179866 r179869 1 2015-02-10 Eric Carlson <eric.carlson@apple.com> 2 3 [iOS] don't get out of sync when interrupt/resume calls are not balanced 4 https://bugs.webkit.org/show_bug.cgi?id=141310 5 6 Reviewed by Jer Noble. 7 8 No new tests, updated media/video-interruption-with-resume-allowing-play.html. 9 10 * platform/audio/MediaSession.cpp: 11 (WebCore::MediaSession::beginInterruption): Count interruptions. 12 (WebCore::MediaSession::endInterruption): Ignore calls when m_interruptionCount is already zero. 13 * platform/audio/MediaSession.h: 14 1 15 2015-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebCore/platform/audio/MediaSession.cpp
r176459 r179869 82 82 void MediaSession::beginInterruption(InterruptionType type) 83 83 { 84 LOG(Media, "MediaSession::beginInterruption(%p), state = %s ", this, stateName(m_state));85 86 if ( type == EnteringBackground && client().overrideBackgroundPlaybackRestriction())84 LOG(Media, "MediaSession::beginInterruption(%p), state = %s, interruption count = %i", this, stateName(m_state), m_interruptionCount); 85 86 if (++m_interruptionCount > 1 || (type == EnteringBackground && client().overrideBackgroundPlaybackRestriction())) 87 87 return; 88 88 … … 96 96 void MediaSession::endInterruption(EndInterruptionFlags flags) 97 97 { 98 LOG(Media, "MediaSession::endInterruption(%p) - flags = %i, stateToRestore = %s", this, (int)flags, stateName(m_stateToRestore)); 98 LOG(Media, "MediaSession::endInterruption(%p) - flags = %i, stateToRestore = %s, interruption count = %i", this, (int)flags, stateName(m_stateToRestore), m_interruptionCount); 99 100 if (!m_interruptionCount) { 101 LOG(Media, "MediaSession::endInterruption(%p) - !! ignoring spurious interruption end !!", this); 102 return; 103 } 104 105 if (--m_interruptionCount) 106 return; 99 107 100 108 State stateToRestore = m_stateToRestore; -
trunk/Source/WebCore/platform/audio/MediaSession.h
r176459 r179869 123 123 State m_state; 124 124 State m_stateToRestore; 125 int m_interruptionCount { 0 }; 125 126 bool m_notifyingClient; 126 127 };
Note:
See TracChangeset
for help on using the changeset viewer.