Commit 1d9d68dd by olly Committed by Oliver Woodman

Assume samples are at start of mdat when offset is negative

We've seen this issue reported three times now, so it's
obviously not an isolated problem. Do you think anything
bad will happen to non-SmoothStreaming playback cases if
I do this? I suspect not, but if you feel strongly I can
easily add a FLAG_WORKAROUND_X flag for it, and enable
it for SmoothStreaming only.

https://github.com/google/ExoPlayer/issues/2292
https://github.com/google/ExoPlayer/issues/2101
https://github.com/google/ExoPlayer/issues/1152

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143583714
parent 4a0f224e
...@@ -952,13 +952,9 @@ public final class FragmentedMp4Extractor implements Extractor { ...@@ -952,13 +952,9 @@ public final class FragmentedMp4Extractor implements Extractor {
// We skip bytes preceding the next sample to read. // We skip bytes preceding the next sample to read.
int bytesToSkip = (int) (nextDataPosition - input.getPosition()); int bytesToSkip = (int) (nextDataPosition - input.getPosition());
if (bytesToSkip < 0) { if (bytesToSkip < 0) {
if (nextDataPosition == currentTrackBundle.fragment.atomPosition) { // Assume the sample data must be contiguous in the mdat with no preceding data.
// Assume the sample data must be contiguous in the mdat with no preceeding data. Log.w(TAG, "Ignoring negative offset to sample data.");
Log.w(TAG, "Offset to sample data was missing."); bytesToSkip = 0;
bytesToSkip = 0;
} else {
throw new ParserException("Offset to sample data was negative.");
}
} }
input.skipFully(bytesToSkip); input.skipFully(bytesToSkip);
this.currentTrackBundle = currentTrackBundle; this.currentTrackBundle = currentTrackBundle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment