Bug 37991

Summary: Do not pause movie when readyState drops below HAVE_FUTURE_DATA
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Severity: Normal CC: abarth, eric, jer.noble, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed patch none

Description Eric Carlson 2010-04-22 08:30:16 PDT
HTMLMediaElement currently calls m_player->pause() when playback stops because the media engine runs out of buffered data. This is unnecessary for downloaded movies because the movie is already "paused", and is harmful for streamed movies because no data is loaded once paused.
Comment 1 Eric Carlson 2010-04-22 08:31:22 PDT
Comment 2 Eric Carlson 2010-04-22 09:36:29 PDT
Created attachment 54066 [details]
Proposed patch
Comment 3 Simon Fraser (smfr) 2010-04-22 09:52:20 PDT
Comment on attachment 54066 [details]
Proposed patch

>  bool HTMLMediaElement::potentiallyPlaying() const
>  {
> -    return m_readyState >= HAVE_FUTURE_DATA && couldPlayIfEnoughData();
> +    bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyState < HAVE_FUTURE_DATA;
> +    return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEnoughData();

I think a comment here would be useful, to explain exactly what pausedToBuffer means.
Comment 4 Eric Carlson 2010-04-22 11:07:03 PDT
Comment 5 WebKit Review Bot 2010-04-22 11:58:45 PDT
http://trac.webkit.org/changeset/58107 might have broken Leopard Intel Release (Tests)
Comment 6 Eric Seidel (no email) 2010-04-22 12:00:29 PDT
Yup.  Looks like this broke Tiger and Leopard test machines:
Comment 7 Eric Carlson 2010-04-22 12:06:29 PDT
I am looking into it.
Comment 8 Eric Carlson 2010-04-22 12:25:37 PDT
Looks like this change has exposed a QuickTime/QTKit bug. Continuing to dig.
Comment 9 Eric Carlson 2010-04-22 12:48:20 PDT
Will need to spend some quality time in QuickTime to figure this out, so these tests added to the Leopard and Tiger skipped lists in http://trac.webkit.org/changeset/58109