diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java b/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java index bcb4b9d2bd..e00f93aa19 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java @@ -547,11 +547,8 @@ public class DefaultHttpDataSource implements HttpDataSource { * @throws IOException If an error occurs reading from the source. */ private int readInternal(byte[] buffer, int offset, int readLength) throws IOException { - readLength = bytesToRead == C.LENGTH_UNSET ? readLength - : (int) Math.min(readLength, bytesToRead - bytesRead); if (readLength == 0) { - // We've read all of the requested data. - return C.RESULT_END_OF_INPUT; + return 0; } int read = inputStream.read(buffer, offset, readLength);