Two small fixes for HLS.

1. Clear prefixFlags when a NAL unit is found.
2. continueBuffering should return true if loading is finished.
This commit is contained in:
Oliver Woodman 2015-02-25 11:37:39 +00:00
parent 6d14fc3330
commit d6ebd49c63
2 changed files with 4 additions and 1 deletions

View File

@ -164,7 +164,7 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
if (!extractors.isEmpty()) {
discardSamplesForDisabledTracks(extractors.getFirst(), downstreamPositionUs);
}
return continueBufferingInternal();
return loadingFinished || continueBufferingInternal();
}
private boolean continueBufferingInternal() throws IOException {

View File

@ -171,6 +171,9 @@ public final class Mp4Util {
// loop advance the index by three.
} else if (data[i - 2] == 0 && data[i - 1] == 0 && data[i] == 1
&& matchesType(data, i + 1, type)) {
if (prefixFlags != null) {
clearPrefixFlags(prefixFlags);
}
return i - 2;
} else {
// There isn't a NAL prefix here, but there might be at the next position. We should