mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix for Apple's I-Frame-only stream playback.
See bug: https://github.com/google/ExoPlayer/issues/7512
This commit is contained in:
parent
8b5ecdb98d
commit
4b1b924cf1
@ -67,6 +67,11 @@ public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtract
|
||||
return extractor.read(extractorInput, POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seek(long position, long timeUs) {
|
||||
extractor.seek( position, timeUs );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPackedAudioExtractor() {
|
||||
return extractor instanceof AdtsExtractor
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user