From: Jaroslav Kysela Date: Tue, 9 Feb 2016 18:51:21 +0000 (+0100) Subject: m3u/hls: fix the #EXT-X-STREAM-INF: parsing, improve stream selection for hls X-Git-Tag: v4.2.1~1047 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aadf893a12d0f29f7c26e4a5f11212c6461bc207;p=thirdparty%2Ftvheadend.git m3u/hls: fix the #EXT-X-STREAM-INF: parsing, improve stream selection for hls --- diff --git a/src/input/mpegts/iptv/iptv_http.c b/src/input/mpegts/iptv/iptv_http.c index 07d0de3ae..647e37d41 100644 --- a/src/input/mpegts/iptv/iptv_http.c +++ b/src/input/mpegts/iptv/iptv_http.c @@ -145,7 +145,8 @@ iptv_http_get_url( http_priv_t *hp, htsmsg_t *m ) sscanf(s, "%dx%d", &width, &height); if (htsmsg_get_str(item, "m3u-url")) if ((width == 0 && sel_bandwidth < bandwidth) || - (bandwidth > 200000 && sel_width < width && sel_height < height)) { + (bandwidth > 200000 && sel_width < width && sel_height < height) || + (sel == NULL && bandwidth > 1000)) { sel = item; sel_bandwidth = bandwidth; sel_width = width; diff --git a/src/misc/m3u.c b/src/misc/m3u.c index e735acb71..cbcfe63c9 100644 --- a/src/misc/m3u.c +++ b/src/misc/m3u.c @@ -199,6 +199,7 @@ multi: t = htsmsg_create_map(); delim = 0; while (*data && delim != '\n' && delim != '\r') { + while (*data && *data <= ' ') data++; p = data; while (*data && *data >= ' ' && *data != '=') data++; if (*data == '=') {