Closed Bug 521176 Opened 13 years ago Closed 13 years ago

Unnecessary HTTP transaction when cloning media decoder

Categories

(Core :: Audio/Video, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kinetik, Assigned: roc)

Details

Attachments

(1 file)

nsHTMLMediaElement::InitializeAsClone creates a clone of the original decoder's nsMediaStream then passes it to the clone's nsMediaDecoder::Load which ends up calling AsyncOpen on a fresh nsHttpChannel in nsMediaChannelStream::OpenChannel.  The fresh channel was previously created by nsMediaStream::CloneData calling RecreateChannel.

I ran into this while writing a test for bug 520908.  Running the test without the fix applied, I expected it to fail consistently.  However, it would randomly pass because the cloned decoder's channel would reach OnStartRequest and set the X-Content-Duration duration on the decoder unexpectedly.
Assignee: nobody → roc
Attached patch fixSplinter Review
I'm not sure how to test this.

One way might be to have some .sjs hackery to set up a set of URLs that only work once each, then return 404. Then we could try loading a Wave file, wait for it to play through and then assume it's fully in the cache, clone it, and play through the clone. If the clone does any HTTP transactions we'd get a network error. We could append a random query parameter to the URL used in each test run so the test works if repeated.

Any better ideas?
Attachment #405403 - Flags: review?(chris.double)
Attachment #405403 - Flags: review?(chris.double) → review+
http://hg.mozilla.org/mozilla-central/rev/af45ce6dc575
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.