mpegpsdemux: Issue with incoming TIME segment and base_time
@bilboed
Submitted by Edward Hervey Link to original bug (#740243)
Description
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.
This was introduced by:
commit a9c0609a
Author: Mark Nauwelaerts mark.nauwelaerts@collabora.co.uk
Date: Fri Oct 12 15:44:03 2012 +0200
mpegdemux: handle upstream TIME segments