tsdemux dot not handle input buffer timestamp discontinuity properly
@vinodkesti
Submitted by Vinod Kesti Link to original bug (#786667)
Description
When there is discontinuity in the RTP input stream rtpjitterbuffer tags bufferas GST_BUFFER_FLAG_DISCONT after discontinuity.
tsdemux reset segment and timestamp when buffer is received with discontinuity. In mpegts_base_chain function below marked code flushes the demuxer and resets the time stamp and segmet due to which the next buffer onward timestamps and segment base starts again from 0. Stream time stamps goes past and all pluigins cribs about the timestamp.
if (GST_BUFFER_IS_DISCONT (buf)) {
GST_DEBUG_OBJECT (base, "Got DISCONT buffer, flushing");
res = mpegts_base_drain (base);
if (G_UNLIKELY (res != GST_FLOW_OK))
return res;
mpegts_base_flush (base, FALSE);
/* In the case of discontinuities in push-mode with TIME segment
* we want to drop all previous observations (hard:TRUE) from
* the packetizer */
if (base->mode == BASE_MODE_PUSHING
&& base->segment.format == GST_FORMAT_TIME) {
mpegts_packetizer_flush (base->packetizer, TRUE);
mpegts_packetizer_clear (base->packetizer);
} else
mpegts_packetizer_flush (base->packetizer, FALSE);
}
In above case tsdemux should generate new segment with current time as base time ??
Version: 1.12.2