mpegpsdemux: Issue with incoming TIME segment and base_time
Submitted by Edward Hervey
When mpegpsdemux works in push mode with incoming TIME segments, something is completely wrong with segment calculation.
Incoming segment: start:0, stop:-1
First SCR detected becomes the base_time : base_time = first_scr (say 5m for this example)
... But then the demuxer adjusts that again by the difference between segment.start and first_scr, so essentially base_time = first_scr + first_scr (we're at 10m now)
When the demuxer comes round to creating the output segments (in _demux_send_segment) it takes the incoming one ... and then "adjusts" it by base_time.
We therefore end up pushing a segment with start == base_time == 2 * first_scr
The first PTS/DTS of that stream are around first_scr => everything gets dropped until it reaches 2 * first_scr.
mpegdemux: handle upstream TIME segments