Commit 4b1b924c by mdobrzyn71

Fix for Apple's I-Frame-only stream playback.

See bug: https://github.com/google/ExoPlayer/issues/7512
parent 8b5ecdb9
......@@ -68,6 +68,11 @@ public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtract
}
@Override
public void seek(long position, long timeUs) {
extractor.seek( position, timeUs );
}
@Override
public boolean isPackedAudioExtractor() {
return extractor instanceof AdtsExtractor
|| extractor instanceof Ac3Extractor
......
......@@ -403,6 +403,15 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
try {
while (!loadCanceled && extractor.read(input)) {}
} catch(EOFException e) {
// See bug: https://github.com/google/ExoPlayer/issues/7512 for more details.
if( input.getPosition() == dataSpec.position + input.getLength() ) {
extractor.seek(0, C.TIME_UNSET);
}
else {
e.fillInStackTrace();
throw e;
}
} finally {
nextLoadPosition = (int) (input.getPosition() - dataSpec.position);
}
......
......@@ -48,6 +48,14 @@ public interface HlsMediaChunkExtractor {
*/
boolean read(ExtractorInput extractorInput) throws IOException;
/**
* Notifies the extractor that a seek has occurred.
*
* @param position The byte offset in the stream from which data will be provided.
* @param timeUs The seek time in microseconds.
*/
void seek(long position, long timeUs);
/** Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4. */
boolean isPackedAudioExtractor();
......
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