mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
dashdemux: only update current reading position when needed
If the seek doesn't set the start/stop position, no need to reposition the download index.
This commit is contained in:
parent
fc72e48a48
commit
d4b4069041
1 changed files with 12 additions and 3 deletions
|
@ -1259,6 +1259,10 @@ end:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define SEEK_UPDATES_PLAY_POSITION(r, start_type, stop_type) \
|
||||
((r >= 0 && start_type != GST_SEEK_TYPE_NONE) || \
|
||||
(r < 0 && stop_type != GST_SEEK_TYPE_NONE))
|
||||
|
||||
static gboolean
|
||||
gst_dash_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
||||
{
|
||||
|
@ -1278,11 +1282,16 @@ gst_dash_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||
gst_event_parse_seek (seek, &rate, &format, &flags, &start_type, &start,
|
||||
&stop_type, &stop);
|
||||
|
||||
/* TODO check if start-type/stop-type is SET */
|
||||
if (demux->segment.rate > 0.0)
|
||||
if (!SEEK_UPDATES_PLAY_POSITION (rate, start_type, stop_type)) {
|
||||
/* nothing to do if we don't have to update the current position */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (demux->segment.rate > 0.0) {
|
||||
target_pos = (GstClockTime) start;
|
||||
else
|
||||
} else {
|
||||
target_pos = (GstClockTime) stop;
|
||||
}
|
||||
|
||||
/* select the requested Period in the Media Presentation */
|
||||
if (!gst_mpd_client_setup_media_presentation (dashdemux->client, target_pos,
|
||||
|
|
Loading…
Reference in a new issue