mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +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:
|
* Text:
|
||||||
* Fix SSA and SubRip to display an in-progress cue when enabling subtitles
|
* Fix SSA and SubRip to display an in-progress cue when enabling subtitles
|
||||||
([#2309](https://github.com/androidx/media/issues/2309)).
|
([#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:
|
* Metadata:
|
||||||
* Image:
|
* Image:
|
||||||
* DataSource:
|
* DataSource:
|
||||||
|
@ -208,6 +208,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||||||
long offsetUs,
|
long offsetUs,
|
||||||
MediaSource.MediaPeriodId mediaPeriodId) {
|
MediaSource.MediaPeriodId mediaPeriodId) {
|
||||||
streamFormat = formats[0];
|
streamFormat = formats[0];
|
||||||
|
streamError = null;
|
||||||
if (!isCuesWithTiming(streamFormat)) {
|
if (!isCuesWithTiming(streamFormat)) {
|
||||||
assertLegacyDecodingEnabledIfRequired();
|
assertLegacyDecodingEnabledIfRequired();
|
||||||
if (subtitleDecoder != null) {
|
if (subtitleDecoder != null) {
|
||||||
@ -460,6 +461,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDisabled() {
|
protected void onDisabled() {
|
||||||
streamFormat = null;
|
streamFormat = null;
|
||||||
|
streamError = null;
|
||||||
finalStreamEndPositionUs = C.TIME_UNSET;
|
finalStreamEndPositionUs = C.TIME_UNSET;
|
||||||
clearOutput();
|
clearOutput();
|
||||||
lastRendererPositionUs = C.TIME_UNSET;
|
lastRendererPositionUs = C.TIME_UNSET;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user