From c5df90b1ece73ff79fa6ce82ce169542f595ffae Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 8 Jan 2021 15:30:10 +0000 Subject: [PATCH] Propagate LoadErrorHandlingPolicy to SingleSampleMediaSource.Factory I think this was missed when integrating DefaultMediaSourceFactory with SingleSampleMediaSource.Factory in https://github.com/google/ExoPlayer/commit/315ba6f324b03ef651773a3bdb43386dcb1281ca Issue: #8430 PiperOrigin-RevId: 350759580 --- RELEASENOTES.md | 5 +++++ .../android/exoplayer2/source/DefaultMediaSourceFactory.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f7177f9fe7..fc4915cd11 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -7,6 +7,11 @@ ([#8349](https://github.com/google/ExoPlayer/issues/8349)). * Fix `MediaCodecRenderer` issue where empty streams would fail to play in bypass mode ([#8374](https://github.com/google/ExoPlayer/issues/8374)). + * Fix propagation of `LoadErrorHandlingPolicy` from + `DefaultMediaSourceFactory` into `SingleSampleMediaSource.Factory` when + creating subtitle media sources from + `MediaItem.playbackProperties.subtitles` + ([#8430](https://github.com/google/ExoPlayer/issues/8430)). * UI: * Fix issue where pop-up menus belonging to `StyledPlayerControlView` would not be dismissed when tapping outside of the menu area or pressing diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java b/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java index 8f85a0ac17..b3955d50c3 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java @@ -251,7 +251,8 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory { MediaSource[] mediaSources = new MediaSource[subtitles.size() + 1]; mediaSources[0] = mediaSource; SingleSampleMediaSource.Factory singleSampleSourceFactory = - new SingleSampleMediaSource.Factory(dataSourceFactory); + new SingleSampleMediaSource.Factory(dataSourceFactory) + .setLoadErrorHandlingPolicy(loadErrorHandlingPolicy); for (int i = 0; i < subtitles.size(); i++) { mediaSources[i + 1] = singleSampleSourceFactory.createMediaSource(