Commit 234a8ecc authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig) Committed by Sebastian Dröge

m3u8: Simplify control flow for sequence update

Split the tail from the rest of the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=788417
parent a563cbbc
......@@ -407,35 +407,32 @@ gst_m3u8_update_check_consistent_media_seqnums (GstM3U8 * self,
/* No match, this means f2 is the last item in the previous playlist
* and we have to start our new playlist at that sequence */
mediasequence = f2->sequence + 1;
for (l = self->files; l; l = l->next) {
f1 = l->data;
f1->sequence = mediasequence;
mediasequence++;
}
l = self->files;
} else {
/* Match, check that all following ones are matching too and continue
* sequence numbers from there on */
mediasequence = f2->sequence;
for (; l; l = l->next) {
for (; l && m; l = l->next, m = m->next) {
f1 = l->data;
f2 = m ? m->data : NULL;
f2 = m->data;
f1->sequence = mediasequence;
mediasequence++;
if (f2) {
if (!g_str_equal (f1->uri, f2->uri)) {
GST_WARNING ("Inconsistent URIs after playlist update");
}
if (!g_str_equal (f1->uri, f2->uri)) {
GST_WARNING ("Inconsistent URIs after playlist update");
}
if (m)
m = m->next;
}
}
for (; l; l = l->next) {
f1 = l->data;
f1->sequence = mediasequence;
mediasequence++;
}
}
return TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment