mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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",
|
/* extraFormat= */ "%s",
|
||||||
/* extraArgs...= */ canWriteSample);
|
/* extraArgs...= */ canWriteSample);
|
||||||
if (dropSamplesBeforeFirstVideoSample
|
if (dropSamplesBeforeFirstVideoSample
|
||||||
|
&& contains(trackTypeToInfo, C.TRACK_TYPE_VIDEO)
|
||||||
&& firstVideoPresentationTimeUs != C.TIME_UNSET
|
&& firstVideoPresentationTimeUs != C.TIME_UNSET
|
||||||
&& presentationTimeUs < firstVideoPresentationTimeUs) {
|
&& presentationTimeUs < firstVideoPresentationTimeUs) {
|
||||||
// Drop the buffer.
|
// Drop the buffer.
|
||||||
|
|
@ -464,6 +465,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
private boolean canWriteSample(@C.TrackType int trackType, long presentationTimeUs) {
|
private boolean canWriteSample(@C.TrackType int trackType, long presentationTimeUs) {
|
||||||
if (dropSamplesBeforeFirstVideoSample
|
if (dropSamplesBeforeFirstVideoSample
|
||||||
&& trackType != C.TRACK_TYPE_VIDEO
|
&& trackType != C.TRACK_TYPE_VIDEO
|
||||||
|
&& contains(trackTypeToInfo, C.TRACK_TYPE_VIDEO)
|
||||||
&& firstVideoPresentationTimeUs == C.TIME_UNSET) {
|
&& firstVideoPresentationTimeUs == C.TIME_UNSET) {
|
||||||
// Haven't received the first video sample yet, so can't write any audio.
|
// Haven't received the first video sample yet, so can't write any audio.
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue