aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/FLACMetaData.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-04 07:09:31 +0200
committerMax Kellermann <max@duempel.org>2012-10-04 10:37:09 +0200
commitb8fdb452be9d79492b4bff84d2990cfcb1da282b (patch)
tree5353ba8365f4d4e3b19bfc78241343eac2637954 /src/decoder/FLACMetaData.hxx
parent6b416ce6be840dcd62aadb70817be602b5a73946 (diff)
downloadmpd-b8fdb452be9d79492b4bff84d2990cfcb1da282b.tar.gz
mpd-b8fdb452be9d79492b4bff84d2990cfcb1da282b.tar.xz
mpd-b8fdb452be9d79492b4bff84d2990cfcb1da282b.zip
decoder/flac: support FLAC files inside archives
Implement the "scan_stream" method that can read tags from any input_stream object. This requires a FLAC__IOCallbacks implementation based on the input_stream API.
Diffstat (limited to 'src/decoder/FLACMetaData.hxx')
-rw-r--r--src/decoder/FLACMetaData.hxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/decoder/FLACMetaData.hxx b/src/decoder/FLACMetaData.hxx
index 9808852f3..7b5eb8b0c 100644
--- a/src/decoder/FLACMetaData.hxx
+++ b/src/decoder/FLACMetaData.hxx
@@ -21,6 +21,7 @@
#define MPD_FLAC_METADATA_H
#include "gcc.h"
+#include "FLACIOHandle.hxx"
#include <FLAC/metadata.h>
@@ -45,10 +46,30 @@ public:
return ::FLAC__metadata_chain_read(chain, path);
}
+ bool Read(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) {
+ return ::FLAC__metadata_chain_read_with_callbacks(chain,
+ handle,
+ callbacks);
+ }
+
+ bool Read(input_stream *is) {
+ return Read(::ToFLACIOHandle(is), ::GetFLACIOCallbacks(is));
+ }
+
bool ReadOgg(const char *path) {
return ::FLAC__metadata_chain_read_ogg(chain, path);
}
+ bool ReadOgg(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) {
+ return ::FLAC__metadata_chain_read_ogg_with_callbacks(chain,
+ handle,
+ callbacks);
+ }
+
+ bool ReadOgg(input_stream *is) {
+ return ReadOgg(::ToFLACIOHandle(is), ::GetFLACIOCallbacks(is));
+ }
+
gcc_pure
FLAC__Metadata_ChainStatus GetStatus() const {
return ::FLAC__metadata_chain_status(chain);