mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix DefaultHttpDataSource read when requested length is 0
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134063990
This commit is contained in:
parent
669cf6804a
commit
654d914bb6
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user