mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
matroskademux: Preserve seqnum when pushing seek upstream
After converting a seek from time to bytes, use the same seqnum on the event that goes upstream
This commit is contained in:
parent
be0eeae491
commit
193ce9110e
1 changed files with 7 additions and 4 deletions
|
@ -171,7 +171,7 @@ static GstCaps
|
||||||
/* stream methods */
|
/* stream methods */
|
||||||
static void gst_matroska_demux_reset (GstElement * element);
|
static void gst_matroska_demux_reset (GstElement * element);
|
||||||
static gboolean perform_seek_to_offset (GstMatroskaDemux * demux,
|
static gboolean perform_seek_to_offset (GstMatroskaDemux * demux,
|
||||||
gdouble rate, guint64 offset);
|
gdouble rate, guint64 offset, guint32 seqnum);
|
||||||
|
|
||||||
/* gobject functions */
|
/* gobject functions */
|
||||||
static void gst_matroska_demux_set_property (GObject * object,
|
static void gst_matroska_demux_set_property (GObject * object,
|
||||||
|
@ -2196,7 +2196,7 @@ finish:
|
||||||
/* upstream takes care of flushing and all that
|
/* upstream takes care of flushing and all that
|
||||||
* ... and newsegment event handling takes care of the rest */
|
* ... and newsegment event handling takes care of the rest */
|
||||||
return perform_seek_to_offset (demux, rate,
|
return perform_seek_to_offset (demux, rate,
|
||||||
entry->pos + demux->common.ebml_segment_start);
|
entry->pos + demux->common.ebml_segment_start, seqnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
@ -2336,7 +2336,8 @@ gst_matroska_demux_handle_seek_push (GstMatroskaDemux * demux, GstPad * pad,
|
||||||
if (!building_index) {
|
if (!building_index) {
|
||||||
/* seek to the first subindex or legacy index */
|
/* seek to the first subindex or legacy index */
|
||||||
GST_INFO_OBJECT (demux, "Seeking to Cues at %" G_GUINT64_FORMAT, offset);
|
GST_INFO_OBJECT (demux, "Seeking to Cues at %" G_GUINT64_FORMAT, offset);
|
||||||
return perform_seek_to_offset (demux, rate, offset);
|
return perform_seek_to_offset (demux, rate, offset,
|
||||||
|
gst_event_get_seqnum (event));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* well, we are handling it already */
|
/* well, we are handling it already */
|
||||||
|
@ -4664,7 +4665,8 @@ pause:
|
||||||
* Create and push a flushing seek event upstream
|
* Create and push a flushing seek event upstream
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
perform_seek_to_offset (GstMatroskaDemux * demux, gdouble rate, guint64 offset)
|
perform_seek_to_offset (GstMatroskaDemux * demux, gdouble rate, guint64 offset,
|
||||||
|
guint32 seqnum)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
gboolean res = 0;
|
gboolean res = 0;
|
||||||
|
@ -4675,6 +4677,7 @@ perform_seek_to_offset (GstMatroskaDemux * demux, gdouble rate, guint64 offset)
|
||||||
gst_event_new_seek (rate, GST_FORMAT_BYTES,
|
gst_event_new_seek (rate, GST_FORMAT_BYTES,
|
||||||
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, offset,
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, offset,
|
||||||
GST_SEEK_TYPE_NONE, -1);
|
GST_SEEK_TYPE_NONE, -1);
|
||||||
|
gst_event_set_seqnum (event, seqnum);
|
||||||
|
|
||||||
res = gst_pad_push_event (demux->common.sinkpad, event);
|
res = gst_pad_push_event (demux->common.sinkpad, event);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue