mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
mpdparser: Refactor to get rid of one level of indentation in seeking code
Also go out of the segment searching loop once segment->start > ts. We're not going to find any earlier segment anymore.
This commit is contained in:
parent
ffa63c5933
commit
43d1dd3dad
1 changed files with 36 additions and 37 deletions
|
@ -4765,19 +4765,20 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
|
|||
gint index = 0;
|
||||
gint repeat_index = 0;
|
||||
GstMediaSegment *selectedChunk = NULL;
|
||||
gboolean in_segment;
|
||||
|
||||
g_return_val_if_fail (stream != NULL, 0);
|
||||
|
||||
if (stream->segments) {
|
||||
for (index = 0; index < stream->segments->len; index++) {
|
||||
gboolean in_segment = FALSE;
|
||||
GstMediaSegment *segment = g_ptr_array_index (stream->segments, index);
|
||||
GstClockTime end_time;
|
||||
|
||||
GST_DEBUG ("Looking at fragment sequence chunk %d / %d", index,
|
||||
stream->segments->len);
|
||||
in_segment = FALSE;
|
||||
if (segment->start <= ts) {
|
||||
GstClockTime end_time;
|
||||
|
||||
if (segment->start > ts)
|
||||
break;
|
||||
|
||||
if (segment->repeat >= 0) {
|
||||
end_time = segment->start + (segment->repeat + 1) * segment->duration;
|
||||
|
@ -4802,8 +4803,7 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
|
|||
&& ((ts - segment->start) % segment->duration == 0))
|
||||
repeat_index--;
|
||||
|
||||
if ((flags & GST_SEEK_FLAG_SNAP_NEAREST) ==
|
||||
GST_SEEK_FLAG_SNAP_NEAREST) {
|
||||
if ((flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST) {
|
||||
/* FIXME implement this */
|
||||
} else if ((forward && flags & GST_SEEK_FLAG_SNAP_AFTER) ||
|
||||
(!forward && flags & GST_SEEK_FLAG_SNAP_BEFORE)) {
|
||||
|
@ -4822,7 +4822,6 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedChunk == NULL) {
|
||||
stream->segment_index = stream->segments->len;
|
||||
|
|
Loading…
Reference in a new issue