if (gst_adaptive_demux_is_live (demux)) {
gint64 range_start, range_stop;
+ gboolean changed = FALSE;
if (!gst_adaptive_demux_get_live_seek_range (demux, &range_start,
&range_stop)) {
GST_MANIFEST_UNLOCK (demux);
return FALSE;
}
+ /* Handle relative positioning for live streams (relative to the range_stop) */
+ if (start_type == GST_SEEK_TYPE_END) {
+ start = range_stop + start;
+ start_type = GST_SEEK_TYPE_SET;
+ changed = TRUE;
+ }
+ if (stop_type == GST_SEEK_TYPE_END) {
+ stop = range_stop + stop;
+ stop_type = GST_SEEK_TYPE_SET;
+ changed = TRUE;
+ }
+
if (!(flags & GST_SEEK_FLAG_ACCURATE)) {
/* If the accurate flag is not set, we allow seeking before the start
* to map to the start for live cases, since those can return a "moving
start = range_start;
if (stop != GST_CLOCK_TIME_NONE)
stop += dt;
+ changed = TRUE;
}
}
gst_event_unref (event);
return FALSE;
}
+
+ if (changed) {
+ gst_event_unref (event);
+ event =
+ gst_event_new_seek (rate, format, flags,
+ start_type, start, stop_type, stop);
+
+ }
}
seqnum = gst_event_get_seqnum (event);