mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Only override gapless data if set in ClippingMediaPeriod
This avoids reading a format that is not equal because of switching between NO_VALUE and 0. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=184298076
This commit is contained in:
parent
258122c89c
commit
8bc5febbb8
1 changed files with 6 additions and 4 deletions
|
|
@ -292,11 +292,13 @@ public final class ClippingMediaPeriod implements MediaPeriod, MediaPeriod.Callb
|
||||||
}
|
}
|
||||||
int result = childStream.readData(formatHolder, buffer, requireFormat);
|
int result = childStream.readData(formatHolder, buffer, requireFormat);
|
||||||
if (result == C.RESULT_FORMAT_READ) {
|
if (result == C.RESULT_FORMAT_READ) {
|
||||||
// Clear gapless playback metadata if the start/end points don't match the media.
|
|
||||||
Format format = formatHolder.format;
|
Format format = formatHolder.format;
|
||||||
int encoderDelay = startUs != 0 ? 0 : format.encoderDelay;
|
if (format.encoderDelay != Format.NO_VALUE || format.encoderPadding != Format.NO_VALUE) {
|
||||||
int encoderPadding = endUs != C.TIME_END_OF_SOURCE ? 0 : format.encoderPadding;
|
// Clear gapless playback metadata if the start/end points don't match the media.
|
||||||
formatHolder.format = format.copyWithGaplessInfo(encoderDelay, encoderPadding);
|
int encoderDelay = startUs != 0 ? 0 : format.encoderDelay;
|
||||||
|
int encoderPadding = endUs != C.TIME_END_OF_SOURCE ? 0 : format.encoderPadding;
|
||||||
|
formatHolder.format = format.copyWithGaplessInfo(encoderDelay, encoderPadding);
|
||||||
|
}
|
||||||
return C.RESULT_FORMAT_READ;
|
return C.RESULT_FORMAT_READ;
|
||||||
}
|
}
|
||||||
if (endUs != C.TIME_END_OF_SOURCE
|
if (endUs != C.TIME_END_OF_SOURCE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue