hls: m3u8playlist: fix silly queue iteration code

This commit is contained in:
Tim-Philipp Müller 2015-08-30 17:01:13 +01:00
parent 4a9a0da50f
commit cae2fa0cef

View file

@ -119,12 +119,12 @@ gst_m3u8_playlist_add_entry (GstM3U8Playlist * playlist,
static guint
gst_m3u8_playlist_target_duration (GstM3U8Playlist * playlist)
{
gint i;
GstM3U8Entry *entry;
guint64 target_duration = 0;
GList *l;
for (l = playlist->entries->head; l != NULL; l = l->next) {
GstM3U8Entry *entry = l->data;
for (i = 0; i < playlist->entries->length; i++) {
entry = (GstM3U8Entry *) g_queue_peek_nth (playlist->entries, i);
if (entry->duration > target_duration)
target_duration = entry->duration;
}