-
Notifications
You must be signed in to change notification settings - Fork 793
Conversation
f4f9045
to
e14622f
Compare
I see that some unit tests fail... probably due to mikrohard@f90651b Guess it'll have to be fixed in a different way. |
@mikrohard thanks! I think I have fixes for the tests worked out. I'd like to spend a little bit of time trying to work out the cause behind 4). Any suggestions on how best to reproduce it? |
Great news about the tests... About issue no. 4... I can't give you a 100% reproducible case. But if you take the sample content I provided above and start seeking to a random position the moment is starts playing (sometimes even before it starts) it should be quite easy reproducible. I reverted my last commit and it took me about a minute to get this: https://dl.dropboxusercontent.com/u/8261657/videojs-hls-seeking-crash.png |
Merge branch 'missing-extradata'. Issue 2 from videojs#279.
e50fc82
to
9e9fed1
Compare
Ok... I did a little digging about issue no. 4. I found out that seek always fails if seeking in between two segments where the preciseDuration of the segment is shorter of the duration provided by the playlist. Here is a list of preciseDuration vs. duration reported by playlist for the above sample: What happens: What I did to fix this: |
@dmlap Any comments about my findings on issue no. 4? |
@mikrohard That must have been fun to track down :/ I'm a little busy working on some live enhancements this week. If you could write up a test case for this, I can get it pulled in quicker. |
Sorry... I did try to get grunt working but it just gets stuck at "Running "jshint:test" (jshint) task" and using 100% CPU. I don't have the time to debug this... I guess it's just gonna have to wait. |
74f57b3
to
1fcdef2
Compare
…shorter than playlist segment duration
Let me explain what (and why) these fixes are necessary.
All these issues can be reproduced and checked with this sample content:
https://dl.dropboxusercontent.com/u/8261657/hls-vod-sample.zip
1.) There could be content with only one program (PMT) and with a non-standard network PID (NIT). In these cases there can be more than one PAT entry and I don't see why we shouldn't be able to play such content. In the first commit I check wether the PAT entry is a PMT or NIT pid and throw an error only if there are multiple PMT-s.
2.) I'm not sure why... but it appears that finishFrame can be called when the stream extraData hasn't been parsed yet. The issue has been introduced with the commit ce689ae The additional check for existing extra data prevents crashing at playback start.
3.) If playlists contain "\r\n" line endings or even whitespace lines the m3u8 parser falsely detects those lines as "empty" segment URI-s. This results in faulty duration calculation and possible failure at playback start. By trimming line data before feeding it into the parser this issue is fixed.
4.) Once again... I'm not sure why. But sometimes during seeking within the sample content provided above there are no tags with desired pts values. This commit prevents crashing and fixes seeking in the provided sample. But there may be a problem in the logic somewhere else.