mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove incorrect frame rate calculation using tkhd
box duration
Frame rate is correctly determined using the media duration from the `mdhd` box and the sample count from the `stsz` box. The fallback calculation using the edited sample count and `tkhd` box duration is incorrect, as added silence at the beginning can increase the track duration without affecting the sample count. No-op change, as we never use the fallback calculation for our sample files in the test. PiperOrigin-RevId: 743081118
This commit is contained in:
parent
a1ed0d4ff6
commit
c0e518df97
@ -757,12 +757,6 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
roleFlags |=
|
||||
firstVideoTrackIndex == C.INDEX_UNSET ? C.ROLE_FLAG_MAIN : C.ROLE_FLAG_ALTERNATE;
|
||||
}
|
||||
if (track.format.frameRate == Format.NO_VALUE
|
||||
&& trackDurationUs > 0
|
||||
&& trackSampleTable.sampleCount > 0) {
|
||||
float frameRate = trackSampleTable.sampleCount / (trackDurationUs / 1000000f);
|
||||
formatBuilder.setFrameRate(frameRate);
|
||||
}
|
||||
if (readingAuxiliaryTracks) {
|
||||
roleFlags |= C.ROLE_FLAG_AUXILIARY;
|
||||
formatBuilder.setAuxiliaryTrackType(auxiliaryTrackTypesForAuxiliaryTracks.get(i));
|
||||
|
Loading…
x
Reference in New Issue
Block a user