mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
dashdemux: remove unnecessary variable
Instead of using 2 indexes that were actually the same, use only one. Saves a variable.
This commit is contained in:
parent
cea909b877
commit
3d2f3bcf62
1 changed files with 8 additions and 9 deletions
|
@ -3394,18 +3394,17 @@ gboolean
|
|||
gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
|
||||
GstClockTime ts)
|
||||
{
|
||||
gint segment_idx = 0;
|
||||
gint index = 0;
|
||||
GstMediaSegment *selectedChunk = NULL;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (stream != NULL, 0);
|
||||
|
||||
GST_MPD_CLIENT_LOCK (client);
|
||||
if (stream->segments) {
|
||||
for (i = 0; i < stream->segments->len; i++, segment_idx++) {
|
||||
GstMediaSegment *segment = g_ptr_array_index (stream->segments, i);
|
||||
for (index = 0; index < stream->segments->len; index++) {
|
||||
GstMediaSegment *segment = g_ptr_array_index (stream->segments, index);
|
||||
|
||||
GST_DEBUG ("Looking at fragment sequence chunk %d", segment_idx);
|
||||
GST_DEBUG ("Looking at fragment sequence chunk %d", index);
|
||||
if (segment->start_time <= ts
|
||||
&& ts < segment->start_time + segment->duration) {
|
||||
selectedChunk = segment;
|
||||
|
@ -3420,16 +3419,16 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream,
|
|||
} else {
|
||||
GstClockTime duration =
|
||||
gst_mpd_client_get_segment_duration (client, stream);
|
||||
g_return_val_if_fail (stream->cur_seg_template->
|
||||
MultSegBaseType->SegmentTimeline == NULL, FALSE);
|
||||
g_return_val_if_fail (stream->cur_seg_template->MultSegBaseType->
|
||||
SegmentTimeline == NULL, FALSE);
|
||||
if (!GST_CLOCK_TIME_IS_VALID (duration)) {
|
||||
GST_MPD_CLIENT_UNLOCK (client);
|
||||
return FALSE;
|
||||
}
|
||||
segment_idx = ts / duration;
|
||||
index = ts / duration;
|
||||
}
|
||||
|
||||
gst_mpd_client_set_segment_index (stream, segment_idx);
|
||||
gst_mpd_client_set_segment_index (stream, index);
|
||||
|
||||
GST_MPD_CLIENT_UNLOCK (client);
|
||||
|
||||
|
|
Loading…
Reference in a new issue