-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooking up a MediaSource for specific subtitles when a video does not have them causes looping to fail after the 2nd play through #7590
Comments
I can't reproduce the problem. I added ExoPlayer/demos/main/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java Line 386 in 6026b91
I tried with both I see the video play (with no visible subtitles, as expected). When it reaches the end it plays again. Aside: I'm not sure passing an MP4 file with embedded WebVTT subtitles to The error you see in the log seems like ExoPlayer is trying to decode 'random' bytes as a WebVTT file and is upset that it doesn't start with the Would you be able to clarify your reproduction steps to help me understand the problem? |
It is the end of the second play-through that then does not loop. So let the mp4 play through once, loop, play again...it's at the end of that loop where it fails to loop again. I originally came across this issue loading an HLS stream that did not include a subtitle track (I was told it did)...the MP4 shown is just a quicker (shorter) was of reproducing the same issue. |
Ah thanks - I'd misunderstood "loop a second time". I can now reproduce. I can also reproduce the same behaviour without changing the repeat mode by seeking during the first playback. I also noticed that at the end of the playback it doesn't fail/crash, the position keeps counting up beyond the end of the video suggesting it thinks there's still subtitle data to decoder. I worked out it's related to this change (before this playback would fail immediately at the start of the first playback): And specifically the fact that we set I'll work on fixing this - thanks for reporting. |
Clearing the exception puts the SimpleDecoder into a silent failure state - the decoder thread is dead (because decode() has returned false) but it's still possible to queue buffers to the decoder (they just never get decoded). This partially reverts 4107375 Also always recreate the decoder when handling an error in TextRenderer This ensures we can try and decode a later subtitle sample after encountering a decode error. This behaviour is what nulling out the exception in SimpleDecoder.flush() was trying to achieve. We need to ensure we don't start passing data to the new decoder until we've hit the next key frame, so we throw away any non-keyframe samples inside TextRenderer#render(). Issue: #7590 PiperOrigin-RevId: 319785908
This should now be fixed on dev-v2. |
[REQUIRED] Issue description
Defining a subtitle media source of specific type/language (via createTextSampleFormat) causes a video to not loop a second time. If I pass NULL into the 'sampleMimeType and 'language' the video will loop perfectly over and over and over again as it should do.
[REQUIRED] Reproduction steps
I changed the demo code to loop and added the following video to media.exolist.json:
{ "name": "test", "uri": "https://html5demos.com/assets/dizzy.mp4", "subtitle_uri": "https://html5demos.com/assets/dizzy.mp4", "subtitle_mime_type": "text/vtt", "subtitle_language": "en" }
[REQUIRED] Link to test content
Using: https://html5demos.com/assets/dizzy.mp4
[REQUIRED] A full bug report captured from the device
testreport.txt The important part of the log can be seen by searching for 'TextRenderer' I think.
[REQUIRED] Version of ExoPlayer being used
2.11.5
[REQUIRED] Device(s) and version(s) of Android being used
Nexus 7 (2nd gen), Android Version: 6.0.1
The text was updated successfully, but these errors were encountered: