Changeset 58107 in webkit


Ignore:
Timestamp:
Apr 22, 2010 11:06:07 AM (14 years ago)
Author:
eric.carlson@apple.com
Message:

2010-04-22 Eric Carlson <eric.carlson@apple.com>

Reviewed by Simon Fraser.

Do not pause movie when readyState drops below HAVE_FUTURE_DATA
https://bugs.webkit.org/show_bug.cgi?id=37991
<rdar://problem/7893937>

No new tests, we don't have infrastructure in DRT to test with streamed
movies.

  • html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_readyStateMaximum. (WebCore::HTMLMediaElement::prepareForLoad): Reset m_readyStateMaximum. (WebCore::HTMLMediaElement::setReadyState): Maintain m_readyStateMaximum. (WebCore::HTMLMediaElement::potentiallyPlaying): Also return true if the readyState was previously >= HAVE_FUTURE_DATA.
  • html/HTMLMediaElement.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58103 r58107  
     12010-04-22  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Do not pause movie when readyState drops below HAVE_FUTURE_DATA
     6        https://bugs.webkit.org/show_bug.cgi?id=37991
     7        <rdar://problem/7893937>
     8
     9        No new tests, we don't have infrastructure in DRT to test with streamed
     10        movies.
     11
     12        * html/HTMLMediaElement.cpp:
     13        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_readyStateMaximum.
     14        (WebCore::HTMLMediaElement::prepareForLoad): Reset m_readyStateMaximum.
     15        (WebCore::HTMLMediaElement::setReadyState): Maintain m_readyStateMaximum.
     16        (WebCore::HTMLMediaElement::potentiallyPlaying): Also return true if the readyState was
     17        previously >= HAVE_FUTURE_DATA.
     18        * html/HTMLMediaElement.h:
     19
    1202010-04-22  Zhenyao Mo  <zmo@google.com>
    221
  • trunk/WebCore/html/HTMLMediaElement.cpp

    r57830 r58107  
    9393    , m_networkState(NETWORK_EMPTY)
    9494    , m_readyState(HAVE_NOTHING)
     95    , m_readyStateMaximum(HAVE_NOTHING)
    9596    , m_volume(1.0f)
    9697    , m_lastSeekTime(0)
     
    494495        m_networkState = NETWORK_EMPTY;
    495496        m_readyState = HAVE_NOTHING;
     497        m_readyStateMaximum = HAVE_NOTHING;
    496498        m_paused = true;
    497499        m_seeking = false;
     
    853855        return;
    854856   
     857    if (oldState > m_readyStateMaximum)
     858        m_readyStateMaximum = oldState;
     859
    855860    if (m_networkState == NETWORK_EMPTY)
    856861        return;
     
    16291634bool HTMLMediaElement::potentiallyPlaying() const
    16301635{
    1631     return m_readyState >= HAVE_FUTURE_DATA && couldPlayIfEnoughData();
     1636    // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
     1637    // when it ran out of buffered data. A movie is this state is "potentially playing", modulo the
     1638    // checks in couldPlayIfEnoughData().
     1639    bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyState < HAVE_FUTURE_DATA;
     1640    return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEnoughData();
    16321641}
    16331642
  • trunk/WebCore/html/HTMLMediaElement.h

    r57109 r58107  
    297297    NetworkState m_networkState;
    298298    ReadyState m_readyState;
     299    ReadyState m_readyStateMaximum;
    299300    String m_currentSrc;
    300301   
Note: See TracChangeset for help on using the changeset viewer.