mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
ignore dropSamplesBeforeFirstVideoSample in audio-only streams
PiperOrigin-RevId: 593126632
This commit is contained in:
parent
64231ee079
commit
4fc11a98a1
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Reference in a new issue