diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/ForceEndOfStreamTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/ForceEndOfStreamTest.java index efd1ebc809..540d5bc7c0 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/ForceEndOfStreamTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/ForceEndOfStreamTest.java @@ -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(); }