mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
asfdemux: fix seeking in push mode
This commit is contained in:
parent
68985ba2ab
commit
f27c832011
2 changed files with 13 additions and 12 deletions
|
@ -190,6 +190,19 @@ gst_asf_payload_queue_for_stream (GstASFDemux * demux, AsfPayload * payload,
|
|||
GST_BUFFER_FLAG_SET (payload->buf, GST_BUFFER_FLAG_DISCONT);
|
||||
}
|
||||
|
||||
/* remember the first queued timestamp for the segment */
|
||||
if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (demux->segment_ts) &&
|
||||
GST_CLOCK_TIME_IS_VALID (demux->first_ts))) {
|
||||
GST_DEBUG_OBJECT (demux, "segment ts: %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (demux->first_ts));
|
||||
demux->segment_ts = demux->first_ts;
|
||||
/* always note, but only determines segment when streaming */
|
||||
if (demux->streaming)
|
||||
gst_segment_do_seek (&demux->segment, demux->in_segment.rate,
|
||||
GST_FORMAT_TIME, (GstSeekFlags) demux->segment.flags,
|
||||
GST_SEEK_TYPE_SET, demux->segment_ts, GST_SEEK_TYPE_NONE, 0, NULL);
|
||||
}
|
||||
|
||||
g_array_append_vals (stream->payloads, payload, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1366,18 +1366,6 @@ gst_asf_demux_check_first_ts (GstASFDemux * demux, gboolean force)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* remember the first queued timestamp for the segment */
|
||||
if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (demux->segment_ts))) {
|
||||
GST_DEBUG_OBJECT (demux, "segment ts: %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (first_ts));
|
||||
demux->segment_ts = first_ts;
|
||||
/* always note, but only determines segment when streaming */
|
||||
if (demux->streaming)
|
||||
gst_segment_do_seek (&demux->segment, demux->in_segment.rate,
|
||||
GST_FORMAT_TIME, (GstSeekFlags) demux->segment.flags,
|
||||
GST_SEEK_TYPE_SET, demux->segment_ts, GST_SEEK_TYPE_NONE, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue