mpegtsbase: Fix previous commit

We only want to do a hard reset of the observations if we're working
with TIME segments in push mode. For BYTE segment we want to keep
the observations (in order to do seeks in push-mode).
This commit is contained in:
Edward Hervey 2015-07-09 18:31:34 +02:00 committed by Edward Hervey
parent 0247dc7489
commit 631b2d8826

View file

@ -1110,7 +1110,14 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
return res;
mpegts_base_flush (base, FALSE);
mpegts_packetizer_flush (base->packetizer, base->mode == BASE_MODE_PUSHING);
/* 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);
else
mpegts_packetizer_flush (base->packetizer, FALSE);
}
mpegts_packetizer_push (base->packetizer, buf);