videojs/videojs-contrib-hls — pull request #8 by dmlap (2014-02-10 18:47:10+00:00)
Title: Close off all FLV tags at the end of a segment

The segment parser allows fragmentary input to the muxing process so it's not always clear when a tag should be finalized at the end of the input. By calling segmentParser.flushTags(), the parser is instructed to wrap up whatever input it currently has buffered into an FLV tag. Before this change, the last tag of the video stream would be buffered in the parser, waiting for additional input (i.e. another segment download) to flush it out. When you seeked within a segment, that last tag would have a timestamp greater than your seek point and we were assuming that timestamp values were sorted in ascending order. We would see the timestamp value greater than the desired seek location and start feeding tags into the media source, which resulted in the segment appearing to restart. Now, we close off any tags that are buffered at the end of a segment so the inter-segment seeking routine can assume that tags are delivered in the order of playback.