Closed Bug 1062101 Opened 6 years ago Closed 6 years ago

The mDuration field of VideoData in MediaSourceReader::OnVideoDecoded is incorrect with WebM

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: cajbir, Assigned: kinetik)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

If a SourceBufferDecoder reaches the end of its data then the associated WebMReader uses GetMediaEndTime to compute the sample duration, taking that time as the time of the next sample.

SourceBufferDecoder::GetMediaEndTime returns the duration of the resource which results in the computed sample time being incorrect. 

Is it safe to change GetMediaEndTime to return the time of the last item in the buffered data for the SourceBufferDecoder? Or do we change WebMReader's behaviour here.
Blocks: MSE
Not sure how I managed that, but I posted bug 1061402's comment here and this bug's comment there.  Made it private to avoid confusion.  Intended comment:

As far as I can tell, GetEndMediaTime is only used by the WebMReader.  I think it's confusing given the existence of GetMediaDuration.  My preference is to remove it entirely, and compute the last frame duration in WebMReader using the Δt between the current and previous frame as the frame duration.
Proposed fix.
Attachment #8483358 - Flags: review?(cajbir.bugzilla)
Attachment #8483358 - Flags: review?(cajbir.bugzilla) → review+
https://hg.mozilla.org/mozilla-central/rev/b83d8447aaaa
Assignee: nobody → kinetik
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Blocks: 1064699
You need to log in before you can comment on or make changes to this bug.