Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 827c4656 authored by Venkatarama Avadhani's avatar Venkatarama Avadhani
Browse files

MP4: Use track header to get playback duration

When an MP4 file is trimmed, the samples may not be removed, but only
the playback duration for the track altered. So, to determine the
playback duration we must use track header's duration.

Add a new field in Track to store the mdhd header duration, which
contains the total duration of the samples contained in the track. This
can be use to determine the padding.

This reapplies aosp/2998978 with the change to store the mdhd duration.

Bug: 329121650
Test: atest MctsMediaExtractorTestCases
      atest MctsMediaV2TestCases:ExtractorTest
      atest MctsMediaV2TestCases:ExtractorUnitTest
      atest CtsMediaMuxerTestCases
      atest CtsMediaV2TestCases:MuxerTest
      atest CtsMediaV2TestCases:MuxerUnitTest

Change-Id: Idd4cbab8dec17fe8e1f815de9b1aa218baaa1fe7
parent 965655e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment