From 65c1faf5535f912f7dc9463d3182597764e36bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 12 Feb 2014 18:47:45 +0100 Subject: [PATCH] hlsdemux: Make sure to ignore \r in line endings in every case --- ext/hls/m3u8.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index 97ac3cc900..fe89c0bbf6 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -263,12 +263,17 @@ gst_m3u8_update (GstM3U8 * self, gchar * data, gboolean * updated) title = NULL; data += 7; while (TRUE) { + gchar *r; + end = g_utf8_strchr (data, -1, '\n'); if (end) *end = '\0'; + r = g_utf8_strchr (data, -1, '\r'); + if (r) + *r = '\0'; + if (data[0] != '#') { - gchar *r; if (duration <= 0 && list == NULL) { GST_LOG ("%s: got line without EXTINF or EXTSTREAMINF, dropping", data); @@ -279,10 +284,6 @@ gst_m3u8_update (GstM3U8 * self, gchar * data, gboolean * updated) if (data == NULL) goto next_line; - r = g_utf8_strchr (data, -1, '\r'); - if (r) - *r = '\0'; - if (list != NULL) { if (g_list_find_custom (self->lists, data, (GCompareFunc) _m3u8_compare_uri)) {