Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ public long open(DataSpec dataSpec) throws HttpDataSourceException {
throw new InvalidContentTypeException(contentType, dataSpec);
}

// If we requested a range starting from a non-zero position and received a 200 rather than a
// 206, then the server does not support partial requests. We'll need to manually skip to the
// requested position.
long bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0;
// If we requested a range starting from a non-zero position and did not receive a 206, then
// the server does not support partial requests. We'll need to manually skip to the requested
// position.
long bytesToSkip = responseCode != 206 && dataSpec.position != 0 ? dataSpec.position : 0;

// Determine the length of the data to be read, after skipping.
boolean isCompressed = isCompressed(connection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ public long open(DataSpec dataSpec) throws HttpDataSourceException {
}
}

// If we requested a range starting from a non-zero position and received a 200 rather than a
// 206, then the server does not support partial requests. We'll need to manually skip to the
// requested position.
long bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0;
// If we requested a range starting from a non-zero position and did not receive a 206, then
// the server does not support partial requests. We'll need to manually skip to the requested
// position.
long bytesToSkip = responseCode != 206 && dataSpec.position != 0 ? dataSpec.position : 0;

// Calculate the content length.
if (!isCompressed(responseInfo)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,10 @@ public long open(DataSpec dataSpec) throws HttpDataSourceException {
}
}

// If we requested a range starting from a non-zero position and received a 200 rather than a
// 206, then the server does not support partial requests. We'll need to manually skip to the
// requested position.
long bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0;
// If we requested a range starting from a non-zero position and did not receive a 206, then
// the server does not support partial requests. We'll need to manually skip to the requested
// position.
long bytesToSkip = responseCode != 206 && dataSpec.position != 0 ? dataSpec.position : 0;

// Calculate the content length.
if (!isCompressed(responseInfo)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private constructor(
throw HttpDataSource.InvalidContentTypeException(contentType, dataSpec)
}

val bytesToSkip = if (responseCode == 200 && dataSpec.position != 0L) dataSpec.position else 0L
val bytesToSkip = if (responseCode != 206 && dataSpec.position != 0L) dataSpec.position else 0L

if (dataSpec.length != C.LENGTH_UNSET.toLong()) {
bytesToRead = dataSpec.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ public long open(DataSpec dataSpec) throws HttpDataSourceException {
throw new InvalidContentTypeException(contentType, dataSpec);
}

// If we requested a range starting from a non-zero position and received a 200 rather than a
// 206, then the server does not support partial requests. We'll need to manually skip to the
// requested position.
long bytesToSkip = responseCode == 200 && dataSpec.position != 0 ? dataSpec.position : 0;
// If we requested a range starting from a non-zero position and did not receive a 206, then
// the server does not support partial requests. We'll need to manually skip to the requested
// position.
long bytesToSkip = responseCode != 206 && dataSpec.position != 0 ? dataSpec.position : 0;

// Determine the length of the data to be read, after skipping.
if (dataSpec.length != C.LENGTH_UNSET) {
Expand Down