Skip to content

After running into a stream error with subtitle track, playback gets stuck every time the subtitle cue is empty #2328

Closed

Description

@vkoehler

Version

Media3 1.6.0

More version details

No response

Devices that reproduce the issue

device independent

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

  1. Play the playlist sent via email. This playlist consists of two live dash channels.
  2. Activate subtitles on the first channel.
  3. Block subtitles stream of the first channel via proxy and wait until it runs into a stream error and subtitle track will be disabled
  4. Switch to the second channel.
  5. Activate subtitles

Expected result

Second channel can be played without issues with activated subtitles.

Actual result

Playback freezes, because the subtitle track with an empty cue never gets ready.

Media

playlist will be sent via email

Bug Report

Activity

  1. vkoehler commented on Apr 11, 2025

    @vkoehler
    Author

    We have some channels, that only provide subtitles for certain shows during the day. For the rest of the shows the subtitle cue is empty. Even for the channels, that provide subtitles for every show, it's not guaranteed, that the subtitle cue is always not empty. Typically during the ad breaks, there will be no input for the subtitle cue.

    I checked the implementation of the isReady() function of the TextRenderer and I see following reasons for this behavior:

    1. Once streamError is set, it will never be cleared.
    2. Once streamError is set, following check "checkNotNull(cuesResolver).getNextCueChangeTimeUs(lastRendererPositionUs) != C.TIME_END_OF_SOURCE" will lead to a not ready state of the TextRenderer whenever the subtitle cue is empty.

    It would help to reset streamError after the subtitle track is disabled. I tried to do it inside of onPositionReset() of TextRenderer and it seems to work, but I'm not sure if it's the right place to do it.

    Also after the subtitle track gets disabled after stream error, I would expect this state to be reflected in onTracksChanged() of Player.Listener, but I see, that the subtitle track stays selected. Is my expectation correct or is there another way how to make the state of the subtitle track transparent to the user?

  2. icbaker commented on Apr 28, 2025

    @icbaker
    Collaborator

    playlist will be sent via email

    I initially struggled to find this because it was sent with the subject Issue #2283, which is a different issue you filed.


    I can reproduce the issue using the steps provided.

    I've sent a fix for review which clears the streamError in both TextRenderer.onStreamChanged and onDisabled.

  3. icbaker commented on Apr 29, 2025

    @icbaker
    Collaborator

    This is fixed by the commit linked above.

  4. locked and limited conversation to collaborators on Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions