Closed Bug 464376 Opened 16 years ago Closed 16 years ago

progress events sometimes not getting fired

Categories

(Core :: Audio/Video, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Dolske, Assigned: cajbir)

References

Details

(Keywords: verified1.9.1)

Attachments

(2 files, 12 obsolete files)

(deleted), text/html
Details
(deleted), patch
cajbir
: review+
cajbir
: superreview+
Details | Diff | Splinter Review
I'm not consistently getting progress events from <video> on current nightly trunk / builds. EG, no "X"s appear on http://www.double.co.nz/video_test/events.html and I'm not seeing them in a video control patch that was previously working (so this presumably regressed recently). Oddly enough, I do get progress events when the video src is a local file, but event.loaded is always 0.
Shift-reload will sometimes give me one small progress event around 4K, but the initial load doesn't (even when the cache has been cleared).
Assignee: nobody → chris.double
Attached patch Progress event patch 1 (obsolete) (deleted) — Splinter Review
Fixes progress events for http resources. Still need to resolve local file issue and write tests.
Attachment #347714 - Attachment is obsolete: true
Attached patch Adds test (obsolete) (deleted) — Splinter Review
Attachment #348499 - Attachment is obsolete: true
Attachment #348905 - Flags: superreview?(roc)
Attachment #348905 - Flags: review?(roc)
Should this be blocking1.9.1? It blocks a blocking1.9.1 bug.
Flags: blocking1.9.1?
Yes.
Flags: blocking1.9.1? → blocking1.9.1+
+ if (mDataTime != 0 && + PR_IntervalToMilliseconds(PR_IntervalNow() - mDataTime) >= STALL_MS) { + mElement->DispatchProgressEvent(NS_LITERAL_STRING("stalled")); + mDataTime = 0; + } + + if (!aTimer) { + mDataTime = PR_IntervalNow(); + } It looks like we could have a situation where data arrives just after STALL_MS causing us to send a "stalled" event. Factor out PR_IntervalNow() into a shared local so we don't call it more than necessary. + if (mElement) { + mElement->DispatchProgressEvent(NS_LITERAL_STRING("progress")); + } Fix indent void nsOggDecoder::UpdateBytesDownloaded(PRUint64 aBytes) { - mBytesDownloaded = aBytes; + nsAutoMonitor mon(mMonitor); + if (mPlayState != PLAY_STATE_LOADING) { + mBytesDownloaded = aBytes; + } } Why is this needed? Don't we need to update the Wave backend too? Seems like we'll need a test for that too.
Attached patch Address review comments (obsolete) (deleted) — Splinter Review
> Why is this needed? During the loading of the metadata the value of the bytes downloaded can be skewed by the results of the seek to get the duration. If progress events are sent during this time then we get the progress.loaded value of the seek to eof to get the duration - which makes it look as if the download has completed. So during the loading of metadata for Ogg files I don't display progress. I've addressed your other comments and added wav test.
Attachment #348905 - Attachment is obsolete: true
Attachment #349696 - Flags: superreview?(roc)
Attachment #349696 - Flags: review?(roc)
Attachment #348905 - Flags: superreview?(roc)
Attachment #348905 - Flags: review?(roc)
Don't we need to StartProgress in nsWaveDecoder::MetadataLoaded instead of ::Load, like we are for Ogg? And stop/start progress in SeekingStarted/SeekingStopped?
StartProgress is done during Load in the wav backend. Since the wav backend doesn't seek when loading metadata like the ogg backend does it doesn't need to wait until then to do it. Seeks immediately go to the correct location in the wav backend, it doesn't oscillate to find the seek point so doesn't need to start/stop the progress eents.
Attachment #349696 - Flags: superreview?(roc)
Attachment #349696 - Flags: superreview+
Attachment #349696 - Flags: review?(roc)
Attachment #349696 - Flags: review+
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [c-n: baking for 1.9.1]
test_progress1 timed out, so backed out commits: *** 29953 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29954 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29955 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29956 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29957 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29958 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29959 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29960 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29961 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29962 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29963 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29964 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29965 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29966 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29967 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29968 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29969 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29970 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29971 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29972 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29973 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29974 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29975 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29976 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29977 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29978 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29979 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29980 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress lengthComputable *** 29981 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress loaded: 0 *** 29982 INFO TEST-PASS | /tests/content/media/video/test/test_progress1.html | Check progress total: 285310 *** 29983 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/video/test/test_progress1.html | Test timed out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [c-n: baking for 1.9.1]
Attached patch Fix test failure (obsolete) (deleted) — Splinter Review
This changes things to make sure that events aren't raised during metadata/duration retrieval, and ensures that a final event is always sent containing the length of the file. This fixes the spurious test failure that was occurring.
Attachment #349696 - Attachment is obsolete: true
Attachment #353548 - Flags: superreview?(roc)
Attachment #353548 - Flags: review?(roc)
Attachment #353548 - Flags: superreview?(roc)
Attachment #353548 - Flags: superreview+
Attachment #353548 - Flags: review?(roc)
Attachment #353548 - Flags: review+
Attached patch Rebase to trunk (obsolete) (deleted) — Splinter Review
Rebase to trunk, carry forward r+sr
Attachment #353548 - Attachment is obsolete: true
Attachment #353577 - Flags: superreview+
Attachment #353577 - Flags: review+
Attached audio Wave file needed for test (obsolete) (deleted) —
This wav file needs to be added to content/media/video/test
Pushed 70b57b58afe2
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs 191 landing]
Attached patch Fix for final progress event not being raised (obsolete) (deleted) — Splinter Review
Applies on top of existing patch
Attachment #353611 - Flags: superreview?(roc)
Attachment #353611 - Flags: review?(roc)
I backed this out because of a test failure on the tinderbox. We decided we need to make some more fixes to WAV on top of attachment 353611 [details] [diff] [review], so we'll wait for that to be done before relanding.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Fix tests and wave backend (obsolete) (deleted) — Splinter Review
Attachment #353577 - Attachment is obsolete: true
Attachment #353611 - Attachment is obsolete: true
Attachment #353618 - Flags: superreview?(roc)
Attachment #353618 - Flags: review?(roc)
Attachment #353611 - Flags: superreview?(roc)
Attachment #353611 - Flags: review?(roc)
Attachment #353578 - Attachment is obsolete: true
Attachment #353618 - Attachment is obsolete: true
Attachment #353623 - Flags: superreview?(roc)
Attachment #353623 - Flags: review?(roc)
Attachment #353618 - Flags: superreview?(roc)
Attachment #353618 - Flags: review?(roc)
Attachment #353623 - Flags: superreview?(roc)
Attachment #353623 - Flags: superreview+
Attachment #353623 - Flags: review?(roc)
Attachment #353623 - Flags: review+
Checked in again as 1a4e7f55120d but backed out due to test timeouts on all platforms, e.g. http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1229588582.1229592245.10136.gz#err5
Whiteboard: [needs 191 landing] → [needs new patch]
Blocks: 470983
I've made the progress event dispatches occur asynchronously and add some dump statements to the failing test. If the async change doesn't fix the breakage the dump's will help track it down. They can be removed if the test passes.
Attachment #353623 - Attachment is obsolete: true
Attachment #355509 - Flags: superreview?(roc)
Attachment #355509 - Flags: review?(roc)
Attachment #355509 - Flags: superreview?(roc)
Attachment #355509 - Flags: superreview+
Attachment #355509 - Flags: review?(roc)
Attachment #355509 - Flags: review+
Whiteboard: [needs new patch] → [needs landing]
Pushed to mozilla-central: http://hg.mozilla.org/mozilla-central/rev/f155c8f39715 I'm holding off marking as resolved until I see the results of the tests.
Making P1 since it blocks the video controls work, which is P1
Priority: P2 → P1
Whiteboard: [needs landing] → [needs new patch]
Hmm, I just rediscovered the ".loaded == 0 for file://" problem I noted in comment 0. Should we spin off a new bug for that problem, or will this patch eventually address that?
I'll address it in this patch. Do you have a testcase?
Attached file Testcase for file:// video src (deleted) —
Testcase: Save this locally along with the linked .ogg, progress events are dumped to the console.
Attached patch Fix test failure (obsolete) (deleted) — Splinter Review
Adds two tests with smaller files to test the case of resource being fully loaded before metadataloaded fires. Fixes issue of not firing last progress event when resource is loaded before metadataloaded fires.
Attachment #355509 - Attachment is obsolete: true
Attachment #357052 - Flags: superreview?(roc)
Attachment #357052 - Flags: review?(roc)
Attachment #357052 - Flags: superreview?(roc)
Attachment #357052 - Flags: superreview+
Attachment #357052 - Flags: review?(roc)
Attachment #357052 - Flags: review+
Comment on attachment 357052 [details] [diff] [review] Fix test failure OK once we've cleaned up nsOggDecoder::ResourceLoaded
Attached patch clean up ResourceLoaded (deleted) — Splinter Review
Clean up ResourceLoaded, carrying forward r+sr=roc
Attachment #357052 - Attachment is obsolete: true
Attachment #357059 - Flags: superreview+
Attachment #357059 - Flags: review+
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
Whiteboard: [needs new patch] → [baking for 1.9.1]
I haven't been able to get test_progress1.html working 100% on Linux (although it passes on Mac and Windows always, as far as I can tell), but I think we should just push this to 1.9.1 as-is since we can't reproduce the failures.
Whiteboard: [baking for 1.9.1] → [needs 191 landing]
Keywords: fixed1.9.1
Whiteboard: [needs 191 landing]
Great testcase. Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1pre) Gecko/20090527 Shiretoko/3.5pre Ubiquity/0.1.5 and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090527 Minefield/3.6a1pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: