diff options
author | Max Kellermann <max@duempel.org> | 2012-10-02 18:24:15 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-10-02 18:24:15 +0200 |
commit | 3c2d73d161814a1cac543f2623671feb0b7c8fe9 (patch) | |
tree | d2d8fd72cb37da0be523695c573c8aee8b31260a /src/decoder/FLACMetaData.cxx | |
parent | 343de8b8ab9b7291151f4b3f5ff12899fd479a8d (diff) | |
download | mpd-3c2d73d161814a1cac543f2623671feb0b7c8fe9.tar.gz mpd-3c2d73d161814a1cac543f2623671feb0b7c8fe9.tar.xz mpd-3c2d73d161814a1cac543f2623671feb0b7c8fe9.zip |
decoder/flac: add method FLACMetadataChain::Scan()
Merge common code.
Diffstat (limited to 'src/decoder/FLACMetaData.cxx')
-rw-r--r-- | src/decoder/FLACMetaData.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/decoder/FLACMetaData.cxx b/src/decoder/FLACMetaData.cxx index 56c8a2764..8d70f149e 100644 --- a/src/decoder/FLACMetaData.cxx +++ b/src/decoder/FLACMetaData.cxx @@ -250,7 +250,15 @@ flac_scan_file2(const char *file, return false; } - FLACMetadataIterator iterator(chain); + chain.Scan(handler, handler_ctx); + return true; +} + +void +FLACMetadataChain::Scan(const struct tag_handler *handler, void *handler_ctx) +{ + FLACMetadataIterator iterator(*this); + do { FLAC__StreamMetadata *block = iterator.GetBlock(); if (block == nullptr) @@ -258,6 +266,4 @@ flac_scan_file2(const char *file, flac_scan_metadata(block, handler, handler_ctx); } while (iterator.Next()); - - return true; } |