Closed Bug 598242 Opened 14 years ago Closed 14 years ago

WebM buffered TimeRanges are not normalized

Categories

(Core :: Audio/Video, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(1 file, 2 obsolete files)

The WebM buffered implementation returns TimeRanges which are in the range [startTime, endTime], but all our other timestamps which we expose to HTML are in the range [0, duration]. We should normalize the WebM buffered timecodes just as we normalize the other media types' TimeRanges, at least until we update our implementation to the current startTime and duration specification.
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → chris
Status: NEW → ASSIGNED
Attachment #477028 - Flags: review?(kinetik)
(In reply to comment #1)
> Created attachment 477028 [details] [diff] [review]
> Patch

This is based on top of bug 598217.
Depends on: 598217
It's kind of a shame the reader's can't deal with time in the media stream's timeline and leave the normalization up to the caller.

       aBuffered->Add(aStartTime / MS_PER_S, duration / NS_PER_S);

This case needs to be fixed too.

Add a mochitest for this case please?
blocking2.0: --- → ?
Attached patch Patch v2 (obsolete) — Splinter Review
* With review comments addressed, includes test.

Fixed some issues test showed up:
* nsWebMReader wasn't timestamping decoded audio chunks correctly, the total_samples variable in nsWebMReader::DecodeAudioPacket() which was used to calculate the timestamps of ogg_packets inside a nestegg_packet was not being carried over between packets, meaning every ogg_packet in a nestegg_packet would have the same start time.
* Handle case in nsWebMReader::DecodeVideoFrame() when we assume the last packet ends at the end of the file.
* Renamed nsBuiltinDecoderStateMachine::mGotDurationFromHeader to mGotDurationFromMetaData, and set moved its initalization up into nsBuiltinDecoderStateMachine::LoadMetadata() (from nsOggDecoderStateMachine::LoadMetadata()). This is needed because the *duration* is stored in the WebM metadata (not the end time), and we need to adjust the mEndTime field for WebM in nsBuiltinDecoderStateMachine::FindStartTime() in the same way that the Ogg backend does for a chopped media.
Attachment #477028 - Attachment is obsolete: true
Attachment #477832 - Flags: review?(kinetik)
Attachment #477028 - Flags: review?(kinetik)
-  { name:"r11025_s16_c1.wav", type:"audio/x-wav", duration:1.0 },
+  { name:"r11025_s16_c1.wav", type:"audio/x-wav", duration:1.0},

Oops?

+      next_tstamp = s->GetEndMediaTime() * NS_PER_MS;

If the WebM file doesn't have a duration, mEndTime is going to be -1 (at least, before UpdatePlaybackPosition is called), so this will compute an invalid next_tstamp, right?
Attached patch Patch v3Splinter Review
Now with less oops.
Attachment #477832 - Attachment is obsolete: true
Attachment #477836 - Flags: review?(kinetik)
Attachment #477832 - Flags: review?(kinetik)
Attachment #477836 - Flags: review?(kinetik) → review+
http://hg.mozilla.org/mozilla-central/rev/5f0b56b5b3b3
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: