Skip to content

Commit

Permalink
Assume samples are at start of mdat when offset is negative
Browse files Browse the repository at this point in the history
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.

#2292
#2101
#1152

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143583714
  • Loading branch information
ojw28 committed Jan 4, 2017
1 parent 1cd6b93 commit 8627a11
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,9 @@ private boolean readSample(ExtractorInput input) throws IOException, Interrupted
// We skip bytes preceding the next sample to read.
int bytesToSkip = (int) (nextDataPosition - input.getPosition());
if (bytesToSkip < 0) {
throw new ParserException("Offset to sample data was negative.");
// Assume the sample data must be contiguous in the mdat with no preceding data.
Log.w(TAG, "Ignoring negative offset to sample data.");
bytesToSkip = 0;
}
input.skipFully(bytesToSkip);
}
Expand Down

0 comments on commit 8627a11

Please sign in to comment.