HLS: fix position and duration for segments in VOD mode
While streaming this url http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8, ts demux can not provide reasonable position and duration.
This patch may fix this problem, by:
- httplive module parses duration from m3u8, and pass it to ts demuxer.
- ts demux save first_pcr for calculating video position.
After DEMUX_SET_POSITION:
- httplive module pass segment start offset to ts demuxer.
- ts demuxer detect discontinuity and save next pcr as resync_first_pcr.
- current_pcr - resync_first_pcr + segment_start would be correct video position
Problems:
- This patch is only tested on Android ports.
- I'm not sure if I have used var_Create/Get/Set correctly.
- After DEMUX_SET_POSITION, output video is broken for several seconds. I don't known how to fix it. Any suggestion ?
Edited by Jean-Baptiste Kempf