Closed
Bug 1199518
Opened 10 years ago
Closed 9 years ago
WebMDemuxer not properly calculating next keyframe time when data isn't buffered
Categories
(Core :: Audio/Video: Playback, defect, P2)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla43
People
(Reporter: jya, Assigned: jya)
Details
Attachments
(2 files, 1 obsolete file)
1.60 KB,
patch
|
kinetik
:
review+
|
Details | Diff | Splinter Review |
6.87 KB,
patch
|
jya
:
review+
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
The logic in WebMDemuxer::GetNextKeyframeTime() is wrong.
It relies on the WebMBufferedState to know where the next keyframe time is. But the WebMBufferedState is only valid for buffered data and notified via NotifyDataArrived().
While this assumption will always work with MSE , it is not guaranteed with plain webm unless the file is local.
The only guaranteed way to find the next keyframe is to keep demuxing until we found one.
The bug will lead to stall when playing data that isn't buffered and the state machine has found that playback is too slow and we should skip to the next keyframe.
Updated•10 years ago
|
Priority: -- → P2
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jyavenard
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8659089 -
Flags: review?(kinetik)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8659090 -
Flags: review?(kinetik)
Updated•9 years ago
|
Attachment #8659089 -
Flags: review?(kinetik) → review+
Comment 3•9 years ago
|
||
Comment on attachment 8659090 [details] [diff] [review]
[webm] P2. Properly determine next keyframe time.
Review of attachment 8659090 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/webm/WebMDemuxer.cpp
@@ +34,5 @@
> PRLogModuleInfo* gWebMDemuxerLog = nullptr;
> extern PRLogModuleInfo* gNesteggLog;
>
> +// How far ahead will we look when searching future keyframe. In microseconds
> +#define MAX_LOOK_AHEAD 10000000
Is there a specific reason for this to be 10s or is it an arbitrary number? Please state either way in the comment.
@@ +914,5 @@
> + sample = mSamples.PopFront();
> + skipSamplesQueue.Push(sample);
> + }
> +
> + while(skipSamplesQueue.GetSize()) {
Space between while and (
@@ +917,5 @@
> +
> + while(skipSamplesQueue.GetSize()) {
> + sample = skipSamplesQueue.PopFront();
> + mSamples.Push(sample);
> + }
It's a shame we can't simply replace mSamples with skipSamplesQueue.
Attachment #8659090 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Matthew Gregan [:kinetik] from comment #3)
> Comment on attachment 8659090 [details] [diff] [review]
> [webm] P2. Properly determine next keyframe time.
>
> Review of attachment 8659090 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/media/webm/WebMDemuxer.cpp
> @@ +34,5 @@
> > PRLogModuleInfo* gWebMDemuxerLog = nullptr;
> > extern PRLogModuleInfo* gNesteggLog;
> >
> > +// How far ahead will we look when searching future keyframe. In microseconds
> > +#define MAX_LOOK_AHEAD 10000000
>
> Is there a specific reason for this to be 10s or is it an arbitrary number?
> Please state either way in the comment.
it's a number coming out of cpearce's bottom :)
youtube's video key frame appears to be 0.8-1.5s appart.
All webm videos I played with either have them at around 2s or none at all (a single keyframe at the beginning)
Do you have another suggestion?
> It's a shame we can't simply replace mSamples with skipSamplesQueue.
maybe I could implement the operator= instead.
Comment 5•9 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #4)
> it's a number coming out of cpearce's bottom :)
>
> youtube's video key frame appears to be 0.8-1.5s appart.
> All webm videos I played with either have them at around 2s or none at all
> (a single keyframe at the beginning)
>
> Do you have another suggestion?
No suggestion, just add something small to the comment to document that it's a bit of a guess based on observed behaviour (but feel free to leave cpearce's posterior out of it!).
Assignee | ||
Comment 6•9 years ago
|
||
Add comment on how the MAX_LOOK_AHEAD came to be.
Implement various operators in MediaRawDataQueue so we don't need to loop doing it all at once.
Amend the logs to show how long we've buffered while searching for the keyframe.
Carrying r+
Attachment #8659712 -
Flags: review+
Assignee | ||
Comment 7•9 years ago
|
||
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/1794ed046155
https://hg.mozilla.org/integration/mozilla-inbound/rev/f72d4bfd2811
Keywords: checkin-needed
Assignee | ||
Updated•9 years ago
|
Attachment #8659090 -
Attachment is obsolete: true
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8659712 [details] [diff] [review]
[webm] P2. Properly determine next keyframe time.
Approval Request Comment
[Feature/regressing bug #]:1148102
[User impact if declined]: Invalid playback ; stalls. Would have to disable the new WebM player and revert to the old one which would reintroduce several bugs
[Describe test coverage new/current, TreeHerder]: Local tests, try runs.
[Risks and why]: Low ; this is properly implementing the API
[String/UUID change made/needed]: None
Attachment #8659712 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
status-firefox42:
--- → affected
Comment 10•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1794ed046155
https://hg.mozilla.org/mozilla-central/rev/f72d4bfd2811
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Updated•9 years ago
|
Attachment #8659712 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 11•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•