From bd5ca15af6218a1299b5d09950388ffdb032d722 Mon Sep 17 00:00:00 2001 From: christosts Date: Wed, 30 Mar 2022 13:54:41 +0100 Subject: [PATCH] Fallback to chunkful preparation if CODECS does not contain audio Issue: google/ExoPlayer#10065 #minor-release PiperOrigin-RevId: 438281023 --- RELEASENOTES.md | 4 ++++ .../java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ae2a28d49b..dcd46f2192 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -35,6 +35,10 @@ views to be used with other `Player` implementations, and removes the dependency from the UI module to the ExoPlayer module. This is a breaking change. +* HLS: + * Fallback to chunkful preparation if the playlist CODECS attribute + does not contain the audio codec + ([#10065](https://github.com/google/ExoPlayer/issues/10065)). * RTSP: * Add RTP reader for MPEG4 ([#35](https://github.com/androidx/media/pull/35)) diff --git a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java index b5822578f8..101bb7a2ed 100644 --- a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java +++ b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/HlsMediaPeriod.java @@ -646,7 +646,8 @@ private void buildAndPrepareMainSampleStreamWrapper( int numberOfVideoCodecs = Util.getCodecCountOfType(codecs, C.TRACK_TYPE_VIDEO); int numberOfAudioCodecs = Util.getCodecCountOfType(codecs, C.TRACK_TYPE_AUDIO); boolean codecsStringAllowsChunklessPreparation = - numberOfAudioCodecs <= 1 + (numberOfAudioCodecs == 1 + || (numberOfAudioCodecs == 0 && multivariantPlaylist.audios.isEmpty())) && numberOfVideoCodecs <= 1 && numberOfAudioCodecs + numberOfVideoCodecs > 0; @C.TrackType