mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
ignore dropSamplesBeforeFirstVideoSample in audio-only streams
PiperOrigin-RevId: 593126632
This commit is contained in:
parent
64231ee079
commit
4fc11a98a1
@ -348,6 +348,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
/* extraFormat= */ "%s",
|
||||
/* extraArgs...= */ canWriteSample);
|
||||
if (dropSamplesBeforeFirstVideoSample
|
||||
&& contains(trackTypeToInfo, C.TRACK_TYPE_VIDEO)
|
||||
&& firstVideoPresentationTimeUs != C.TIME_UNSET
|
||||
&& presentationTimeUs < firstVideoPresentationTimeUs) {
|
||||
// Drop the buffer.
|
||||
@ -464,6 +465,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
private boolean canWriteSample(@C.TrackType int trackType, long presentationTimeUs) {
|
||||
if (dropSamplesBeforeFirstVideoSample
|
||||
&& trackType != C.TRACK_TYPE_VIDEO
|
||||
&& contains(trackTypeToInfo, C.TRACK_TYPE_VIDEO)
|
||||
&& firstVideoPresentationTimeUs == C.TIME_UNSET) {
|
||||
// Haven't received the first video sample yet, so can't write any audio.
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user