Bug 37991 - Do not pause movie when readyState drops below HAVE_FUTURE_DATA
Summary: Do not pause movie when readyState drops below HAVE_FUTURE_DATA
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eric Carlson
Keywords: InRadar
Depends on:
Reported: 2010-04-22 08:30 PDT by Eric Carlson
Modified: 2010-04-22 12:48 PDT (History)
4 users (show)

See Also:

Proposed patch (2.98 KB, patch)
2010-04-22 09:36 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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