Bug 470721 - Elisa does not play .m3u8 playlists that contain embedded #EXTM3U and #EXTINF: tags
Summary: Elisa does not play .m3u8 playlists that contain embedded #EXTM3U and #EXTINF...
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 23.04.1
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-06 21:43 UTC by Daniel Paulo Garcia
Modified: 2024-04-26 16:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
.m3u8 file that Elisa can't play. (1.17 KB, audio/x-mpegurl)
2023-06-06 21:43 UTC, Daniel Paulo Garcia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Paulo Garcia 2023-06-06 21:43:38 UTC
Created attachment 159504 [details]
.m3u8 file that Elisa can't play.

STEPS TO REPRODUCE
1. Rip a music CD using Exact Audio Copy, following this guide:
https://flemmingss.com/perfect-cd-ripping-to-flac-with-exact-audio-copy/
...except that i choose to create a .m3u UFT8 file with extended information.
2. Move the files into the library directory.
3. Scan for new songs, none are found.
4. Try to manually open the .m3u8 playlist by dragging and dropping it into the playlist panel. No success either.

OBSERVED RESULTS
1. Scanning for new music does not work.
2. Trying to manually open the .m3u8 file results in this error message:
"Failed to load some tracks. Make sure that they have not been removed or renamed."

EXPECTED RESULT
1. The album and its songs should be found by Elisa.
2. The playlist should open without errors.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.1.31-2-MANJARO (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-7400 CPU @ 3.00GHz
Memory: 7.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
ADDITIONAL INFORMATION
mpv Media Player had no problem to open my playlist.
Elisa can play the FLAC files just fine if i open them manually.
Also, I've double checked all of the filenames and none of them are different from the ones listed inside the .m3u8 file.
I've attached my .m3u8 file just in case.
Comment 1 Daniel Paulo Garcia 2023-06-06 22:05:39 UTC
I think i figured out what's happening. If i open this file on VLC, it will try to add "#EXTM3U" to the playlist and give an error, even though this is not a filename but just some metadata. Since Elisa uses VLC as the backend (which was the worst decision ever, but i digress), it can't reproduce my playlist.
Comment 2 Nate Graham 2023-06-07 19:00:00 UTC
Can reproduce.

FWIW with Qt6, it's feasible to only use the QtMultiMedia backend and ditch VLC.
Comment 3 Daniel Paulo Garcia 2023-06-07 21:36:19 UTC
(In reply to Nate Graham from comment #2)

Thanks for the reply!
I guess I'll have to annoy the Manjaro package maintainers until they remove VLC as a dependency for Elisa haha
For now, I'm going to try to compile Elisa against Qt6 myself as you suggested.
Comment 4 Bug Janitor Service 2024-04-16 11:37:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/572
Comment 5 Jack Hill 2024-04-16 11:38:10 UTC
I don't think this is an issue with the # tags.

The file you provided is encoded using CRLF line terminators, i.e. lines end with '\r\n' instead of just '\n'. This meant that the file paths were being read like "01 OP.flac\r" which does not correspond to the correct file. Please can you test the above merge request, if you are able to?
Comment 6 Jack Hill 2024-04-26 16:07:29 UTC
Git commit 558bef47e298b6bb132fe3c58570a35575ecea6e by Jack Hill.
Committed on 26/04/2024 at 16:00.
Pushed by jackh into branch 'master'.

Fix loading playlists encoded with CRLF

CRLF files end with \r\n. We were not accounting for the extra \r, so
were looking for music files like "myfile.flac\r"

Test-plan:
1. Create a sample playlist file
2. Convert to crlf with `unix2dos -n input.m3u output.m3u`
3. Confirm crlf endings with `cat -A output.m3u` (lines should end with
   ^M$)
4. Import playlist into Elisa

Before: error. Now: works fine

Also added a unit test.

M  +37   -0    autotests/mediaplaylistproxymodeltest.cpp
M  +4    -0    autotests/mediaplaylistproxymodeltest.h
M  +1    -1    src/mediaplaylistproxymodel.cpp

https://invent.kde.org/multimedia/elisa/-/commit/558bef47e298b6bb132fe3c58570a35575ecea6e