hlsdemux: Make sure to ignore \r in line endings in every case

This commit is contained in:
Sebastian Dröge 2014-02-12 18:47:45 +01:00
parent 13997abbf9
commit 65c1faf553

View file

@ -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)) {