mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 18:50:48 +00:00
tsdemux: Remember requested seek rate and use it
The new seek handling re-creates the segment time information once it has enough information after a seek. The problem was that we'd completely ignore the requested rate. So store that and use it in the newly created segment. https://bugzilla.gnome.org/show_bug.cgi?id=694369
This commit is contained in:
parent
95d5a8055b
commit
1f7fa9be1d
2 changed files with 8 additions and 1 deletions
|
@ -320,6 +320,7 @@ gst_ts_demux_reset (MpegTSBase * base)
|
|||
|
||||
demux->calculate_update_segment = FALSE;
|
||||
|
||||
demux->rate = 1.0;
|
||||
gst_segment_init (&demux->segment, GST_FORMAT_UNDEFINED);
|
||||
if (demux->segment_event) {
|
||||
gst_event_unref (demux->segment_event);
|
||||
|
@ -536,8 +537,9 @@ gst_ts_demux_do_seek (MpegTSBase * base, GstEvent * event)
|
|||
goto done;
|
||||
}
|
||||
|
||||
/* record offset */
|
||||
/* record offset and rate */
|
||||
base->seek_offset = start_offset;
|
||||
demux->rate = rate;
|
||||
res = GST_FLOW_OK;
|
||||
|
||||
/* Drop segment info, it needs to be recreated after the actual seek */
|
||||
|
@ -1425,6 +1427,7 @@ calculate_and_push_newsegment (GstTSDemux * demux, TSDemuxStream * stream)
|
|||
demux->segment.stop = GST_CLOCK_TIME_NONE;
|
||||
demux->segment.position = firstts;
|
||||
demux->segment.time = firstts;
|
||||
demux->segment.rate = demux->rate;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1576,6 +1579,7 @@ gst_ts_demux_flush (MpegTSBase * base, gboolean hard)
|
|||
demux->calculate_update_segment = FALSE;
|
||||
if (hard) {
|
||||
/* For pull mode seeks the current segment needs to be preserved */
|
||||
demux->rate = 1.0;
|
||||
gst_segment_init (&demux->segment, GST_FORMAT_UNDEFINED);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,9 @@ struct _GstTSDemux
|
|||
|
||||
/* Full stream duration */
|
||||
GstClockTime duration;
|
||||
|
||||
/* Pending seek rate (default 1.0) */
|
||||
gdouble rate;
|
||||
};
|
||||
|
||||
struct _GstTSDemuxClass
|
||||
|
|
Loading…
Reference in a new issue