mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Clear TextRenderer.streamError
when disabling or changing stream
Previously a stream error from one playlist item was incorrectly preserved when switching to the next one, resulting in playback hanging. Issue: androidx/media#2328 PiperOrigin-RevId: 752624979
This commit is contained in:
parent
4d7046c187
commit
ecfd9d1e92
@ -42,6 +42,9 @@
|
||||
* Text:
|
||||
* Fix SSA and SubRip to display an in-progress cue when enabling subtitles
|
||||
([#2309](https://github.com/androidx/media/issues/2309)).
|
||||
* Fix playback getting stuck when switching from a stream with a subtitle
|
||||
error to a live stream with an empty subtitle track
|
||||
([#2328](https://github.com/androidx/media/issues/2328)).
|
||||
* Metadata:
|
||||
* Image:
|
||||
* DataSource:
|
||||
|
@ -208,6 +208,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
||||
long offsetUs,
|
||||
MediaSource.MediaPeriodId mediaPeriodId) {
|
||||
streamFormat = formats[0];
|
||||
streamError = null;
|
||||
if (!isCuesWithTiming(streamFormat)) {
|
||||
assertLegacyDecodingEnabledIfRequired();
|
||||
if (subtitleDecoder != null) {
|
||||
@ -460,6 +461,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
||||
@Override
|
||||
protected void onDisabled() {
|
||||
streamFormat = null;
|
||||
streamError = null;
|
||||
finalStreamEndPositionUs = C.TIME_UNSET;
|
||||
clearOutput();
|
||||
lastRendererPositionUs = C.TIME_UNSET;
|
||||
|
Loading…
x
Reference in New Issue
Block a user