mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Bypass sniffing for single extractor
Sniffing is performed in ProgressiveMediaPeriod even if a single extractor is provided. Skip it in that case to improve performances. Issue:#6325 PiperOrigin-RevId: 266766373
This commit is contained in:
parent
aff9e731b2
commit
82d10e2ea8
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
### dev-v2 (not yet released) ###
|
### dev-v2 (not yet released) ###
|
||||||
|
|
||||||
|
* Bypass sniffing in `ProgressiveMediaPeriod` in case a single extractor is
|
||||||
|
provided ([#6325](https://github.com/google/ExoPlayer/issues/6325)).
|
||||||
* Surface information provided by methods `isHardwareAccelerated`,
|
* Surface information provided by methods `isHardwareAccelerated`,
|
||||||
`isSoftwareOnly` and `isVendor` added in Android Q in `MediaCodecInfo` class
|
`isSoftwareOnly` and `isVendor` added in Android Q in `MediaCodecInfo` class
|
||||||
([#5839](https://github.com/google/ExoPlayer/issues/5839)).
|
([#5839](https://github.com/google/ExoPlayer/issues/5839)).
|
||||||
|
@ -1068,21 +1068,28 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|||||||
if (extractor != null) {
|
if (extractor != null) {
|
||||||
return extractor;
|
return extractor;
|
||||||
}
|
}
|
||||||
for (Extractor extractor : extractors) {
|
if (extractors.length == 1) {
|
||||||
try {
|
this.extractor = extractors[0];
|
||||||
if (extractor.sniff(input)) {
|
} else {
|
||||||
this.extractor = extractor;
|
for (Extractor extractor : extractors) {
|
||||||
break;
|
try {
|
||||||
|
if (extractor.sniff(input)) {
|
||||||
|
this.extractor = extractor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (EOFException e) {
|
||||||
|
// Do nothing.
|
||||||
|
} finally {
|
||||||
|
input.resetPeekPosition();
|
||||||
}
|
}
|
||||||
} catch (EOFException e) {
|
|
||||||
// Do nothing.
|
|
||||||
} finally {
|
|
||||||
input.resetPeekPosition();
|
|
||||||
}
|
}
|
||||||
}
|
if (extractor == null) {
|
||||||
if (extractor == null) {
|
throw new UnrecognizedInputFormatException(
|
||||||
throw new UnrecognizedInputFormatException("None of the available extractors ("
|
"None of the available extractors ("
|
||||||
+ Util.getCommaDelimitedSimpleClassNames(extractors) + ") could read the stream.", uri);
|
+ Util.getCommaDelimitedSimpleClassNames(extractors)
|
||||||
|
+ ") could read the stream.",
|
||||||
|
uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
extractor.init(output);
|
extractor.init(output);
|
||||||
return extractor;
|
return extractor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user