mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +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;
|
return extractor.read(extractorInput, POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void seek(long position, long timeUs) {
|
||||||
|
extractor.seek( position, timeUs );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPackedAudioExtractor() {
|
public boolean isPackedAudioExtractor() {
|
||||||
return extractor instanceof AdtsExtractor
|
return extractor instanceof AdtsExtractor
|
||||||
|
@ -403,6 +403,15 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
while (!loadCanceled && extractor.read(input)) {}
|
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 {
|
} finally {
|
||||||
nextLoadPosition = (int) (input.getPosition() - dataSpec.position);
|
nextLoadPosition = (int) (input.getPosition() - dataSpec.position);
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,14 @@ public interface HlsMediaChunkExtractor {
|
|||||||
*/
|
*/
|
||||||
boolean read(ExtractorInput extractorInput) throws IOException;
|
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. */
|
/** Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4. */
|
||||||
boolean isPackedAudioExtractor();
|
boolean isPackedAudioExtractor();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user