media/libraries
ibaker 0f0a20bc1c Use MediaCodec.stop() before release() for surface switching bug
ExoPlayer used to call `stop()` before `release()`. This was removed in
<unknown commit>.

A framework bug introduced in Android 11 (API 30) resulted in some
DRM -> clear transitions failing during `MediaCodec.configure()`. An
investigation in Issue: google/ExoPlayer#8696 and b/191966399 identified that this was
due to `release()` returning 'too early' and the subsequent
`configure()` call was then trying to re-use a `Surface` that hadn't
been fully detached from the previous codec. This was fixed in
Android 13 (API 33) with http://r.android.com/2094347.

ExoPlayer worked around the framework bug by adding an arbitrary 50ms
sleep after a failed codec initialization, followed by retrying. This
was enough to resolve the problem in the test scenario on a OnePlus
AC2003.

Issue: androidx/media#1497 points out that 50ms might not be the appropriate delay
for all devices, so it's an incomplete fix. They suggested re-adding the
`MediaCodec.stop()` call instead. This also reliably resolves the issue
on the OnePlus AC2003 (with neither workaround in place, the problem
repros almost immediately).
PiperOrigin-RevId: 646461943

(cherry picked from commit 5fcc7433a1)
2024-07-02 14:11:38 +00:00
..
cast Merge pull request #1437 from MGaetan89:add_exoplayer_setMaxSeekToPreviousPosition 2024-06-17 14:57:01 +00:00
common Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage 2024-07-02 14:11:38 +00:00
container Parse 'max num reorder samples' values from h.264 and h.265 videos 2024-06-14 03:31:38 -07:00
database Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource Fix an invalid javadoc link 2024-06-10 07:34:29 -07:00
datasource_cronet Remove deprecated setContentTypePredicate() methods 2024-05-23 08:32:26 -07:00
datasource_okhttp Remove OkHttpDataSource constructors & OkHttDataSourceFactory 2024-05-23 10:03:12 -07:00
datasource_rtmp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
decoder Don't enforce SimpleDecoder skipping for samples before start time 2024-05-01 06:42:36 -07:00
decoder_av1 Replace or suppress deprecated usages 2024-01-26 10:06:18 -08:00
decoder_ffmpeg Replace or suppress deprecated usages 2024-01-26 10:06:18 -08:00
decoder_flac Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
decoder_midi Add missing module registrations 2024-05-23 04:50:01 -07:00
decoder_opus Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
decoder_vp9 Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
effect support hdr text overlays 2024-06-13 10:41:09 -07:00
exoplayer Use MediaCodec.stop() before release() for surface switching bug 2024-07-02 14:11:38 +00:00
exoplayer_dash Remove deprecated DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS 2024-05-24 07:11:39 -07:00
exoplayer_hls Rename DummyTrackOutput and DummyExtractorOutput 2024-07-02 14:11:38 +00:00
exoplayer_ima Remove Bundleable type & Bundleable.Creator<Foo> CREATOR fields 2024-06-11 08:05:32 -07:00
exoplayer_rtsp Remove /* package */ comment from public classes 2024-05-15 05:23:30 -07:00
exoplayer_smoothstreaming Default to parse subtitles while extracting, instead of while rendering 2024-05-16 01:42:56 -07:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Rename DummyTrackOutput and DummyExtractorOutput 2024-07-02 14:11:38 +00:00
muxer Write moov box at the start of the file if possible 2024-06-17 03:38:11 -07:00
session Clarify that onPlayWhenReadyChanged can be called again with new reason 2024-07-02 14:11:37 +00:00
test_data Write moov box at the start of the file if possible 2024-06-17 03:38:11 -07:00
test_exoplayer_playback Suppress incorrect linter error in DebugRenderersFactory method 2024-05-30 07:05:27 -07:00
test_session_common Clarify that onPlayWhenReadyChanged can be called again with new reason 2024-07-02 14:11:37 +00:00
test_session_current Clarify that onPlayWhenReadyChanged can be called again with new reason 2024-07-02 14:11:37 +00:00
test_utils Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage 2024-07-02 14:11:38 +00:00
test_utils_robolectric Increase h.264 buffer size in ShadowMediaCodecConfig 2024-05-30 03:57:35 -07:00
transformer Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage 2024-07-02 14:11:38 +00:00
ui Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage 2024-07-02 14:11:38 +00:00
ui_leanback Bump effect and leanback minSdk to 19 2024-01-10 07:22:00 -08:00
lint.xml Update recommended way to suppress @UnstableApi errors in lint.xml 2023-11-15 02:34:40 -08:00