From 71eec8ead1572dedcca01f635793ae0f31f3f7b2 Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 17 Mar 2020 14:39:56 +0000 Subject: [PATCH] Fix unrealistic FakeSampleStream.isReady The FakeSampleStream is currently always ready even if it doesn't have any samples to read. Fix that by checking for the conditions under which read() will be successful. PiperOrigin-RevId: 301371031 --- .../google/android/exoplayer2/testutil/FakeSampleStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeSampleStream.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeSampleStream.java index 67c444f72a..0edef520f3 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeSampleStream.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeSampleStream.java @@ -164,7 +164,7 @@ public final class FakeSampleStream implements SampleStream { @Override public boolean isReady() { - return true; + return !readFormat || readEOSBuffer || !fakeSampleStreamItems.isEmpty(); } @Override