mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Simplify notification of downstream format change for embedded track
- There's no particular need to read or skip a sample before notifying - Add missing isPendingReset check Issue: #4533 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=211959762
This commit is contained in:
parent
38386c480a
commit
cb5c78917c
1 changed files with 7 additions and 10 deletions
|
|
@ -753,6 +753,10 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||
|
||||
@Override
|
||||
public int skipData(long positionUs) {
|
||||
if (isPendingReset()) {
|
||||
return 0;
|
||||
}
|
||||
maybeNotifyTrackFormatChanged();
|
||||
int skipCount;
|
||||
if (loadingFinished && positionUs > sampleQueue.getLargestQueuedTimestampUs()) {
|
||||
skipCount = sampleQueue.advanceToEnd();
|
||||
|
|
@ -762,9 +766,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||
skipCount = 0;
|
||||
}
|
||||
}
|
||||
if (skipCount > 0) {
|
||||
maybeNotifyTrackFormatChanged();
|
||||
}
|
||||
return skipCount;
|
||||
}
|
||||
|
||||
|
|
@ -779,13 +780,9 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||
if (isPendingReset()) {
|
||||
return C.RESULT_NOTHING_READ;
|
||||
}
|
||||
int result =
|
||||
sampleQueue.read(
|
||||
formatHolder, buffer, formatRequired, loadingFinished, decodeOnlyUntilPositionUs);
|
||||
if (result == C.RESULT_BUFFER_READ) {
|
||||
maybeNotifyTrackFormatChanged();
|
||||
}
|
||||
return result;
|
||||
maybeNotifyTrackFormatChanged();
|
||||
return sampleQueue.read(
|
||||
formatHolder, buffer, formatRequired, loadingFinished, decodeOnlyUntilPositionUs);
|
||||
}
|
||||
|
||||
public void release() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue