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",
|
/* 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…
x
Reference in New Issue
Block a user