From e3fa7914c6573ea25995e2f9b5f8975c8df96e59 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Sat, 5 Jun 2021 19:36:27 +0200 Subject: [PATCH] mediaplayer: Support m3u playlists containing urls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #6670 Change-Id: I8e15b1a79f1d2a687108c3c2a1fc3fc341b79cc5 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4050 Tested-by: Commit checker robot Reviewed-by: Jérôme Duval Reviewed-by: Axel Dörfler --- src/apps/mediaplayer/playlist/Playlist.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apps/mediaplayer/playlist/Playlist.cpp b/src/apps/mediaplayer/playlist/Playlist.cpp index 8dfa6499eb..7f4e63165b 100644 --- a/src/apps/mediaplayer/playlist/Playlist.cpp +++ b/src/apps/mediaplayer/playlist/Playlist.cpp @@ -596,7 +596,15 @@ Playlist::AppendM3uToPlaylist(const entry_ref& ref, Playlist* playlist) if (item == NULL || !playlist->AddItem(item)) delete item; } else { - printf("Error - %s: [%" B_PRIx32 "]\n", strerror(err), err); + BUrl url(line.String()); + if (url.IsValid()) { + PlaylistItem* item + = new (std::nothrow) UrlPlaylistItem(url); + if (item == NULL || !playlist->AddItem(item)) + delete item; + } else { + printf("Error - %s: [%" B_PRIx32 "]\n", strerror(err), err); + } } }