mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Explicitly fail playback if new format has no sampleMimeType
This avoids a NullPointerException later when the format is used. Fixes https://github.com/google/ExoPlayer/issues/8283. PiperOrigin-RevId: 348017149
This commit is contained in:
parent
fe5176c009
commit
8fb15f97ca
1 changed files with 5 additions and 0 deletions
|
|
@ -1382,6 +1382,11 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||||
throws ExoPlaybackException {
|
throws ExoPlaybackException {
|
||||||
waitingForFirstSampleInFormat = true;
|
waitingForFirstSampleInFormat = true;
|
||||||
Format newFormat = checkNotNull(formatHolder.format);
|
Format newFormat = checkNotNull(formatHolder.format);
|
||||||
|
if (newFormat.sampleMimeType == null) {
|
||||||
|
// If the new format is invalid, it is either a media bug or it is not intended to be played.
|
||||||
|
// See also https://github.com/google/ExoPlayer/issues/8283.
|
||||||
|
throw createRendererException(new IllegalArgumentException(), newFormat);
|
||||||
|
}
|
||||||
setSourceDrmSession(formatHolder.drmSession);
|
setSourceDrmSession(formatHolder.drmSession);
|
||||||
inputFormat = newFormat;
|
inputFormat = newFormat;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue