mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
matroskademux: cleanly initialize and set needed segment
Fixes #673165.
This commit is contained in:
parent
628816784f
commit
e90c67b3a9
1 changed files with 6 additions and 1 deletions
|
@ -3375,7 +3375,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
|
|
||||||
/* need to refresh segment info ASAP */
|
/* need to refresh segment info ASAP */
|
||||||
if (GST_CLOCK_TIME_IS_VALID (lace_time) && demux->need_newsegment) {
|
if (GST_CLOCK_TIME_IS_VALID (lace_time) && demux->need_newsegment) {
|
||||||
guint64 clace_time;
|
guint64 clace_time, duration;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux,
|
GST_DEBUG_OBJECT (demux,
|
||||||
"generating segment starting at %" GST_TIME_FORMAT,
|
"generating segment starting at %" GST_TIME_FORMAT,
|
||||||
|
@ -3387,9 +3387,14 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
GST_TIME_ARGS (lace_time));
|
GST_TIME_ARGS (lace_time));
|
||||||
}
|
}
|
||||||
clace_time = MAX (lace_time, demux->stream_start_time);
|
clace_time = MAX (lace_time, demux->stream_start_time);
|
||||||
|
duration = demux->common.segment.duration;
|
||||||
|
/* we really want to set, don't care much about previous state */
|
||||||
|
gst_segment_init (&demux->common.segment, GST_FORMAT_TIME);
|
||||||
gst_segment_set_newsegment (&demux->common.segment, FALSE,
|
gst_segment_set_newsegment (&demux->common.segment, FALSE,
|
||||||
demux->common.segment.rate, GST_FORMAT_TIME, clace_time,
|
demux->common.segment.rate, GST_FORMAT_TIME, clace_time,
|
||||||
GST_CLOCK_TIME_NONE, clace_time - demux->stream_start_time);
|
GST_CLOCK_TIME_NONE, clace_time - demux->stream_start_time);
|
||||||
|
gst_segment_set_duration (&demux->common.segment, GST_FORMAT_TIME,
|
||||||
|
duration);
|
||||||
/* now convey our segment notion downstream */
|
/* now convey our segment notion downstream */
|
||||||
gst_matroska_demux_send_event (demux, gst_event_new_new_segment (FALSE,
|
gst_matroska_demux_send_event (demux, gst_event_new_new_segment (FALSE,
|
||||||
demux->common.segment.rate, demux->common.segment.format,
|
demux->common.segment.rate, demux->common.segment.format,
|
||||||
|
|
Loading…
Reference in a new issue