Merge pull request #1792 from DolbyLaboratories:dlb/elst-handling/dev

PiperOrigin-RevId: 685851466
This commit is contained in:
Copybara-Service 2024-10-14 15:20:17 -07:00
commit 4df9d4e146
2 changed files with 10 additions and 5 deletions

View file

@ -73,6 +73,11 @@
* Improved frame rate calculation by using media duration from the `mdhd` * Improved frame rate calculation by using media duration from the `mdhd`
box in `Mp4Extractor` and `FragmentedMp4Extractor` box in `Mp4Extractor` and `FragmentedMp4Extractor`
([#1531](https://github.com/androidx/media/issues/1531)). ([#1531](https://github.com/androidx/media/issues/1531)).
* Fix incorrect scaling of `media_time` in MP4 edit lists. While
`segment_duration` was already correctly scaled using the movie
timescale, `media_time` is now properly scaled using the track
timescale, as specified by the MP4 format standard
([#1792](https://github.com/androidx/media/issues/1792)).
* DataSource: * DataSource:
* Audio: * Audio:
* Fix pop sounds that may occur during seeks. * Fix pop sounds that may occur during seeks.

View file

@ -1149,12 +1149,12 @@ public class FragmentedMp4Extractor implements Extractor {
if (track.editListDurations[0] == 0) { if (track.editListDurations[0] == 0) {
return true; return true;
} }
long editListEndMediaTimeUs = long editListDurationUs =
Util.scaleLargeTimestamp( Util.scaleLargeTimestamp(
track.editListDurations[0] + track.editListMediaTimes[0], track.editListDurations[0], C.MICROS_PER_SECOND, track.movieTimescale);
C.MICROS_PER_SECOND, long editListMediaTimeUs =
track.movieTimescale); Util.scaleLargeTimestamp(track.editListMediaTimes[0], C.MICROS_PER_SECOND, track.timescale);
return editListEndMediaTimeUs >= track.durationUs; return editListDurationUs + editListMediaTimeUs >= track.durationUs;
} }
/** /**