From f076080434c24a00309098ef3afc350d175ec4bb Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 15 Jan 2021 10:45:18 +0000 Subject: [PATCH] Default `SingleSampleMediaSource.treatLoadErrorsAsEndOfStream` to true Issue: #8430 PiperOrigin-RevId: 351971671 --- RELEASENOTES.md | 2 ++ .../android/exoplayer2/source/SingleSampleMediaSource.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7a207f03ca..7c8b851deb 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -119,6 +119,8 @@ * Remove `ExoPlaybackException.OutOfMemoryError`. * Remove `setVideoDecoderOutputBufferRenderer` from Player API. Clients should use `setOutputSurface` directly instead. + * Default `SingleSampleMediaSource.treatLoadErrorsAsEndOfStream` to `true` + ([#8430](https://github.com/google/ExoPlayer/issues/8430)). * Extractors: * Populate codecs string for H.264/AVC in MP4, Matroska and FLV streams to allow decoder capability checks based on codec profile/level diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java index 8d7882bb72..627a9da0c4 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java @@ -55,6 +55,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource { public Factory(DataSource.Factory dataSourceFactory) { this.dataSourceFactory = checkNotNull(dataSourceFactory); loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy(); + treatLoadErrorsAsEndOfStream = true; } /** @@ -118,7 +119,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource { /** * Sets whether load errors will be treated as end-of-stream signal (load errors will not be - * propagated). The default value is false. + * propagated). The default value is true. * * @param treatLoadErrorsAsEndOfStream If true, load errors will not be propagated by sample * streams, treating them as ended instead. If false, load errors will be propagated