-
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
MergingMediaSource failed when use side loaded Text tracks #1853
Comments
I have to notice that in case of no side loaded content we still need a callback dispatched from DashMediaPeriod's constructor. So it would be not an easy solution without know all aspects of the ExoPlayer structure. |
I have the same problem. My workaround: Modify MergingMediaPeriod.java, MergingMediaSource.java and SingleSampleMediaPeriod.java. First, change MergingMediaPeriod.java line 175.
to
Then add code, MergingMediaSource.java, line 121
Finally initialize sampleData in SingleSampleMediaPeriod.java |
@andrewlewis - Fixing this may well link into getting all the |
The issue is best understood by looking at
Some |
Issue: #1853 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134409897
Dear colleagues,
In the current ExoPlayer v2, when use side loaded text tracks along side with dash source, there is last track missing in the MergingMediaPeriod#periods field. It results to NullPointerException at the line 180 of the MergingMediaPeriod.java.
I did investigation and found that callback.onPrepared() dispatches too earlier, in fact prior to MediaPeriod added to the array.
Be more specific, there are two callbacks that dispatches prior to MediaPeriod added to the array:
All these callback dispatches prior to MergingMediaSource.java line 120. Upon this callback MergingMediaPeriod decremented counter at the line 175, that leads to the wrong "pendingChildPrepareCount == 0" event and reveal farther logic. Then, when execution reached line 179, there is missing element in "periods" array.
I eliminate this effect temporary by commented callback "callback.onPrepared(this);" on lines 103 and 79 (described above) and modify MergingMediaSource.java:
I added media sources as:
Also, still a bug in the SingleSampleMediaPeriod.java and it's filed "private byte[] sampleData" line 239. It is necessary to initialize it as well by:
Otherwise there is NullPointerException at the line 267.
Excuse me for such technical description with dive into code, I hope that you will understand the issue.
The text was updated successfully, but these errors were encountered: