New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 662615 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Fully buffered HTMLMediaElement stays in network state loading

Project Member Reported by sande...@chromium.org, Nov 5 2016

Issue description

Forked from https://bugs.chromium.org/p/chromium/issues/detail?id=569538#c15.

In the sample provided by the reporter, many of the created video elements stall in network state loading despite being fully buffered (NotifyDownloading() is never called), thus preventing them from being garbage collected.

I have attached a reduced sample which removes the main loop, uses global variables for easier debugging, and retains the no-user-gesture behavior of the original sample. The issue reproduces on about 95% of loads on my machine.
 
video-leak.html
730 bytes View Download
small.mp4
374 KB View Download

Comment 1 by hubbe@chromium.org, Nov 7 2016

How do I know if the provided example fails?

video.networkState == 2

Comment 3 by hubbe@chromium.org, Nov 7 2016

Status: Started (was: Assigned)
video.networkstate is always undefined on my ToT build

Comment 4 by hubbe@chromium.org, Nov 7 2016

Oops, video.networkState is always 1 on my ToT build.


Project Member

Comment 5 by bugdroid1@chromium.org, Nov 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a

commit a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a
Author: hubbe <hubbe@chromium.org>
Date: Wed Nov 09 04:28:06 2016

media: Make sure we transition back to a non-loading state

An earilier bug-workaround kept the media in a loading state when
a read operation was pending, but didn't always transition back to
idle when the read operation was done. This CL fixes the problem
by making sure that we check the loading state after read callbacks.

These extra calls to check the loading state can in some cases cause
us to miss progress callbacks. We fix this by allowing in-flight
progress callbacks to complete even if reader_ has been destroyed.

BUG= 662615 

Review-Url: https://codereview.chromium.org/2481673004
Cr-Commit-Position: refs/heads/master@{#430860}

[modify] https://crrev.com/a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a/media/blink/multibuffer_data_source.cc
[modify] https://crrev.com/a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a/media/blink/multibuffer_data_source_unittest.cc
[modify] https://crrev.com/a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a/media/blink/multibuffer_reader.cc

Comment 6 by hubbe@chromium.org, Nov 9 2016

Status: Fixed (was: Started)
This is a leak no, so it should be merged?

Comment 8 by hubbe@chromium.org, Nov 9 2016

Labels: Merge-Request-55

Comment 9 by dimu@chromium.org, Nov 10 2016

Labels: -Merge-Request-55 Merge-Approved-55 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M55 (branch: 2883)
Project Member

Comment 10 by bugdroid1@chromium.org, Nov 10 2016

Labels: -merge-approved-55 merge-merged-2883
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/726c376476785452c478c4bc928c12c1eb62e35d

commit 726c376476785452c478c4bc928c12c1eb62e35d
Author: Fredrik Hubinette <hubbe@google.com>
Date: Thu Nov 10 18:29:57 2016

media: Make sure we transition back to a non-loading state

An earilier bug-workaround kept the media in a loading state when
a read operation was pending, but didn't always transition back to
idle when the read operation was done. This CL fixes the problem
by making sure that we check the loading state after read callbacks.

These extra calls to check the loading state can in some cases cause
us to miss progress callbacks. We fix this by allowing in-flight
progress callbacks to complete even if reader_ has been destroyed.

BUG= 662615 

Review-Url: https://codereview.chromium.org/2481673004
Cr-Commit-Position: refs/heads/master@{#430860}
(cherry picked from commit a89cc8bcb5d204e3f42eb56d2db24837ba0d3a8a)

Review URL: https://codereview.chromium.org/2495633002 .

Cr-Commit-Position: refs/branch-heads/2883@{#521}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/726c376476785452c478c4bc928c12c1eb62e35d/media/blink/multibuffer_data_source.cc
[modify] https://crrev.com/726c376476785452c478c4bc928c12c1eb62e35d/media/blink/multibuffer_data_source_unittest.cc
[modify] https://crrev.com/726c376476785452c478c4bc928c12c1eb62e35d/media/blink/multibuffer_reader.cc

Cc: kavvaru@chromium.org
Labels: Needs-Feedback
Tested the issue on windows 7 using chrome version 55.0.2883.52 with the below steps

1.Opened the video-leak.html
2.Clicked on Again
3.Move the mouse on the image
4.Not observed any user gesture along with the mouse.

Please find the attached screen cast and provide us steps to verify the fix from test team end.

Note::Getting the blank for the video-leak.html on both Linux and MacOS.

Thanks,
662615.mp4
507 KB View Download

Comment 12 by hubbe@chromium.org, Nov 16 2016

In order to verify this bug you actually have to put video-leak.html and small.mp4 into a directory served by an HTTP server that doesn't support ranges.
One way to do so is to run "python -m SimpleHTTPServer 8000" in a directory containing those files.

Then (after loading video-leak.html) you have to open up the dev console and type "video.networkState". If the result is 2, the test has failed.

Labels: TE-Verfied-55.0.2883.52
Thank you hubbe@, Verified the fix by following steps provided in comment#12 on Windows 7,10, Mac and Linux with Chrome Version 55.0.2883.52. 

Sign in to add a comment