Don't die if we seek past highest PTS value we have tags for
Showing
2 changed files
with
9 additions
and
3 deletions
... | @@ -302,6 +302,7 @@ | ... | @@ -302,6 +302,7 @@ |
302 | 302 | ||
303 | h264Frame.endNalUnit(); | 303 | h264Frame.endNalUnit(); |
304 | this.tags.push(h264Frame); | 304 | this.tags.push(h264Frame); |
305 | |||
305 | } | 306 | } |
306 | 307 | ||
307 | h264Frame = null; | 308 | h264Frame = null; |
... | @@ -427,7 +428,9 @@ | ... | @@ -427,7 +428,9 @@ |
427 | 428 | ||
428 | // We did not find any start codes. Try again next packet | 429 | // We did not find any start codes. Try again next packet |
429 | state = 1; | 430 | state = 1; |
430 | h264Frame.writeBytes(data, start, length); | 431 | if (h264Frame) { |
432 | h264Frame.writeBytes(data, start, length); | ||
433 | } | ||
431 | return; | 434 | return; |
432 | case 3: | 435 | case 3: |
433 | // The next byte is the first byte of a NAL Unit | 436 | // The next byte is the first byte of a NAL Unit | ... | ... |
... | @@ -406,12 +406,15 @@ var | ... | @@ -406,12 +406,15 @@ var |
406 | (function() { | 406 | (function() { |
407 | var tag = segmentParser.getTags()[0]; | 407 | var tag = segmentParser.getTags()[0]; |
408 | 408 | ||
409 | for (; tag.pts < offset; tag = segmentParser.getTags()[0]) { | 409 | for (; tag && tag.pts < offset; tag = segmentParser.getTags()[0]) { |
410 | segmentParser.getNextTag(); | 410 | segmentParser.getNextTag(); |
411 | } | 411 | } |
412 | 412 | ||
413 | // tell the SWF where we will be seeking to | 413 | // tell the SWF where we will be seeking to |
414 | player.hls.el().vjs_setProperty('currentTime', tag.pts * 0.001); | 414 | if (tag) { |
415 | player.hls.el().vjs_setProperty('currentTime', tag.pts * 0.001); | ||
416 | } | ||
417 | |||
415 | lastSeekedTime = null; | 418 | lastSeekedTime = null; |
416 | })(); | 419 | })(); |
417 | } | 420 | } | ... | ... |
-
Please register or sign in to post a comment