Fix test failuer on real-device

In the previous CL, muxer timeout is set to the surface timeout, which is
incorrect.

PiperOrigin-RevId: 650203505
This commit is contained in:
claincly 2024-07-08 04:38:04 -07:00 committed by Copybara-Service
parent 58ff8fa3c2
commit d0a29400ea

View File

@ -21,6 +21,7 @@ import static androidx.media3.transformer.AndroidTestUtil.FORCE_TRANSCODE_VIDEO_
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET;
import static androidx.media3.transformer.AndroidTestUtil.assumeFormatsSupported;
import static com.google.common.truth.Truth.assertThat;
import static java.lang.Math.max;
import android.content.Context;
import android.media.MediaCodec;
@ -56,6 +57,8 @@ public class ForceEndOfStreamTest {
// Referenced from ExternalTextureManager
private static final long SURFACE_TEXTURE_TIMEOUT_MS = isRunningOnEmulator() ? 20_000 : 500;
private static final long MUXER_MAX_DELAYS_BETWEEN_SAMPLES_MS =
max(SURFACE_TEXTURE_TIMEOUT_MS, Transformer.DEFAULT_MAX_DELAY_BETWEEN_MUXER_SAMPLES_MS);
private final Context context = ApplicationProvider.getApplicationContext();
@Rule public final TestName testName = new TestName();
@ -128,7 +131,7 @@ public class ForceEndOfStreamTest {
context,
new FrameDroppingDecoderFactory(context, MP4_ASSET.videoFrameCount, framesToSkip),
Clock.DEFAULT))
.setMaxDelayBetweenMuxerSamplesMs(SURFACE_TEXTURE_TIMEOUT_MS)
.setMaxDelayBetweenMuxerSamplesMs(MUXER_MAX_DELAYS_BETWEEN_SAMPLES_MS)
.build();
}