diff --git a/NEWS b/NEWS index baea3bf76..33c15fca8 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ ver 0.22 (not yet released) - mad: remove option "gapless", always do gapless - sidplay: add option "default_genre" - sidplay: map SID name field to "Album" tag +* playlist + - flac: support reading CUE sheets from remote FLAC files * filter - ffmpeg: new plugin based on FFmpeg's libavfilter library - hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback diff --git a/src/playlist/plugins/FlacPlaylistPlugin.cxx b/src/playlist/plugins/FlacPlaylistPlugin.cxx index a0892aaaf..30793aeac 100644 --- a/src/playlist/plugins/FlacPlaylistPlugin.cxx +++ b/src/playlist/plugins/FlacPlaylistPlugin.cxx @@ -29,9 +29,7 @@ #include "lib/xiph/FlacMetadataChain.hxx" #include "lib/xiph/FlacMetadataIterator.hxx" #include "song/DetachedSong.hxx" -#include "fs/Traits.hxx" -#include "fs/AllocatedPath.hxx" -#include "fs/NarrowPath.hxx" +#include "input/InputStream.hxx" #include "util/RuntimeError.hxx" #include "util/ScopeExit.hxx" @@ -66,22 +64,15 @@ ToSongEnumerator(const char *uri, } static std::unique_ptr -flac_playlist_open_uri(const char *uri, - gcc_unused Mutex &mutex) +flac_playlist_open_stream(InputStreamPtr &&is) { - if (!PathTraitsUTF8::IsAbsolute(uri)) - /* only local files supported */ - return nullptr; - - const auto path_fs = AllocatedPath::FromUTF8Throw(uri); - - const NarrowPath narrow_path_fs(path_fs); - FlacMetadataChain chain; - if (!chain.Read(narrow_path_fs)) + if (!chain.Read(*is)) throw FormatRuntimeError("Failed to read FLAC metadata: %s", chain.GetStatusString()); + const char *const uri = is->GetURI(); + FlacMetadataIterator iterator((FLAC__Metadata_Chain *)chain); unsigned sample_rate = 0; @@ -120,8 +111,8 @@ const struct playlist_plugin flac_playlist_plugin = { nullptr, nullptr, - flac_playlist_open_uri, nullptr, + flac_playlist_open_stream, nullptr, flac_playlist_suffixes,