media/libraries
ibaker 483426ad7b MCR: Ensure mediaCrypto and codec are atomically non-null
`mediaCrypto` is initialized before `codec` in
`maybeInitCodecOrBypass`. Before this change, it was possible for
`maybeInitCodecOrBypass` to complete with `mediaCrypto != null` and
`codec == null`, in particular if it was run as part of clearing the
player surface (since in that case, no video codec is initialized).
This inconsistent state then causes issues during a later invocation of
`maybeInitCodecOrBypass`, when `mediaCrypto` is still non-null, and
`mediaCryptoRequiresSecureDecoder = true`, but the
content has been changed to unencrypted with no associated DRM session.
This results in a playback error, because a secure decoder is
initialized but there's no DRM session available to work with it.

This change ensures that when `maybeInitCodecOrBypass` completes,
either both `mediaCrypto != null` and `codec != null` (i.e. codec
initialization was completed) or `mediaCrypto == null` and
`codec == null` (i.e. codec initialization was not completed). We also
ensure that when nulling out `mediaCrypto` we also set
`maybeInitCodecOrBypass = false`. A later change should be able to
demote `maybeInitCodecOrBypass` from a field to a local in order to
remove any risk of that part of state becoming out of sync. This
resolves the issue, because during the second invocation of
`maybeInitCodecOrBypass` an insecure decoder is now (correctly)
initialized and the unencrypted content is successfully played.

#minor-release

PiperOrigin-RevId: 587713911
(cherry picked from commit 913f6da083)
2024-01-08 16:40:28 +00:00
..
cast Return empty timeline when media info is null 2024-01-08 15:18:39 +00:00
common Don't include null text or bitmaps in Cue.toBundle() 2024-01-08 16:16:21 +00:00
container Merge pull request #491 from v-novaltd:dsparano-exo128 2023-10-23 13:15:17 +01:00
database Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource Add formatting to scheme list in DefaultDataSource javadoc 2023-10-23 13:15:17 +01:00
datasource_cronet Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource_okhttp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
datasource_rtmp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
decoder Deprecate decode-only flag. 2023-10-06 15:57:25 +01:00
decoder_av1 Add Decoder.setOutputStartTimeUs and use it in extension decoders 2023-10-06 15:57:25 +01:00
decoder_ffmpeg Merge pull request #707 from equeim:ffmpeg-6.0 2024-01-08 15:31:27 +00:00
decoder_flac Add more data to e2etest dumps 2023-07-13 15:33:33 +01:00
decoder_midi MidiExtractor: mark only the first sample as key-frame 2024-01-08 15:26:03 +00:00
decoder_opus Explicitly mark DecoderOutputBuffer as shouldBeSkipped if needed 2023-10-06 15:57:24 +01:00
decoder_vp9 Add Decoder.setOutputStartTimeUs and use it in extension decoders 2023-10-06 15:57:25 +01:00
effect Update emulator device names 2024-01-08 15:55:36 +00:00
exoplayer MCR: Ensure mediaCrypto and codec are atomically non-null 2024-01-08 16:40:28 +00:00
exoplayer_dash Fix typo in DashManifestParser 2024-01-08 15:31:29 +00:00
exoplayer_hls Calculate HLS live playlist refresh interval accurately 2023-10-23 13:15:16 +01:00
exoplayer_ima Bump IMA SDK version to 3.31.0 2023-09-21 05:54:13 -07:00
exoplayer_rtsp Merge pull request #491 from v-novaltd:dsparano-exo128 2023-10-23 13:15:17 +01:00
exoplayer_smoothstreaming Add functionality to transmit CMCD data using query parameters 2023-08-31 02:11:12 -07:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Merge pull request #491 from v-novaltd:dsparano-exo128 2023-10-23 13:15:17 +01:00
muxer Make sure the mdat box is not extended by more than 1 GB at a time. 2023-09-08 04:07:13 -07:00
session Remove redundant ) in Javadoc 2024-01-08 15:31:29 +00:00
test_data Don't include null text or bitmaps in Cue.toBundle() 2024-01-08 16:16:21 +00:00
test_exoplayer_playback Add android.namespace to all build.gradle files 2023-05-19 17:19:15 +01:00
test_session_common Add session extras to the state of the controller 2024-01-08 15:26:08 +00:00
test_session_current Add session extras to the state of the controller 2024-01-08 15:26:08 +00:00
test_utils Update emulator device names 2024-01-08 15:55:36 +00:00
test_utils_robolectric Enable offload scheduling by default for audio-only offload playback 2023-09-13 06:46:50 -07:00
transformer Update emulator device names 2024-01-08 15:55:36 +00:00
ui Workaround layout problems with Material Design 2024-01-08 15:18:38 +00:00
ui_leanback Prevent forwarding of zero video size to Leanback 2023-08-30 12:20:51 -07:00
lint.xml Update recommended way to suppress @UnstableApi errors in lint.xml 2024-01-08 15:18:38 +00:00