Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
92c89f0c
Commit
92c89f0c
authored
Aug 15, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/flac: allow reading from FLAC streams
parent
34246eb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
NEWS
NEWS
+2
-0
FlacPlaylistPlugin.cxx
src/playlist/plugins/FlacPlaylistPlugin.cxx
+6
-15
No files found.
NEWS
View file @
92c89f0c
...
...
@@ -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
...
...
src/playlist/plugins/FlacPlaylistPlugin.cxx
View file @
92c89f0c
...
...
@@ -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
<
SongEnumerator
>
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_f
s
))
if
(
!
chain
.
Read
(
*
i
s
))
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment