mirror of
https://github.com/samsonjs/media.git
synced 2026-04-06 11:25:46 +00:00
Migrate literal usages of 1000 to (new) C.MILLIS_PER_SECOND
This only covers calls to scaleLargeTimestamp() PiperOrigin-RevId: 261878019
This commit is contained in:
parent
4603188165
commit
3b9288b805
3 changed files with 10 additions and 5 deletions
|
|
@ -965,7 +965,9 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||
// duration == 0). Other uses of edit lists are uncommon and unsupported.
|
||||
if (track.editListDurations != null && track.editListDurations.length == 1
|
||||
&& track.editListDurations[0] == 0) {
|
||||
edtsOffset = Util.scaleLargeTimestamp(track.editListMediaTimes[0], 1000, track.timescale);
|
||||
edtsOffset =
|
||||
Util.scaleLargeTimestamp(
|
||||
track.editListMediaTimes[0], C.MILLIS_PER_SECOND, track.timescale);
|
||||
}
|
||||
|
||||
int[] sampleSizeTable = fragment.sampleSizeTable;
|
||||
|
|
@ -993,12 +995,13 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||
// here, because unsigned integers will still be parsed correctly (unless their top bit is
|
||||
// set, which is never true in practice because sample offsets are always small).
|
||||
int sampleOffset = trun.readInt();
|
||||
sampleCompositionTimeOffsetTable[i] = (int) ((sampleOffset * 1000L) / timescale);
|
||||
sampleCompositionTimeOffsetTable[i] =
|
||||
(int) ((sampleOffset * C.MILLIS_PER_SECOND) / timescale);
|
||||
} else {
|
||||
sampleCompositionTimeOffsetTable[i] = 0;
|
||||
}
|
||||
sampleDecodingTimeTable[i] =
|
||||
Util.scaleLargeTimestamp(cumulativeTime, 1000, timescale) - edtsOffset;
|
||||
Util.scaleLargeTimestamp(cumulativeTime, C.MILLIS_PER_SECOND, timescale) - edtsOffset;
|
||||
sampleSizeTable[i] = sampleSize;
|
||||
sampleIsSyncFrameTable[i] = ((sampleFlags >> 16) & 0x1) == 0
|
||||
&& (!workaroundEveryVideoFrameIsSyncFrame || i == 0);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package com.google.android.exoplayer2.metadata.emsg;
|
||||
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.metadata.Metadata;
|
||||
import com.google.android.exoplayer2.metadata.MetadataDecoder;
|
||||
import com.google.android.exoplayer2.metadata.MetadataInputBuffer;
|
||||
|
|
@ -46,7 +47,8 @@ public final class EventMessageDecoder implements MetadataDecoder {
|
|||
// timestamp and zeroing the field in the sample data. Log a warning if the field is non-zero.
|
||||
Log.w(TAG, "Ignoring non-zero presentation_time_delta: " + presentationTimeDelta);
|
||||
}
|
||||
long durationMs = Util.scaleLargeTimestamp(emsgData.readUnsignedInt(), 1000, timescale);
|
||||
long durationMs =
|
||||
Util.scaleLargeTimestamp(emsgData.readUnsignedInt(), C.MILLIS_PER_SECOND, timescale);
|
||||
long id = emsgData.readUnsignedInt();
|
||||
byte[] messageData = Arrays.copyOfRange(data, emsgData.getPosition(), size);
|
||||
return new Metadata(new EventMessage(schemeIdUri, value, durationMs, id, messageData));
|
||||
|
|
|
|||
|
|
@ -899,7 +899,7 @@ public class DashManifestParser extends DefaultHandler
|
|||
long id = parseLong(xpp, "id", 0);
|
||||
long duration = parseLong(xpp, "duration", C.TIME_UNSET);
|
||||
long presentationTime = parseLong(xpp, "presentationTime", 0);
|
||||
long durationMs = Util.scaleLargeTimestamp(duration, 1000, timescale);
|
||||
long durationMs = Util.scaleLargeTimestamp(duration, C.MILLIS_PER_SECOND, timescale);
|
||||
long presentationTimesUs = Util.scaleLargeTimestamp(presentationTime, C.MICROS_PER_SECOND,
|
||||
timescale);
|
||||
String messageData = parseString(xpp, "messageData", null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue