lib/xiph/VorbisComments: return std::unique_ptr<Tag>
This commit is contained in:
@@ -100,12 +100,12 @@ vorbis_comments_scan(char **comments,
|
||||
|
||||
}
|
||||
|
||||
Tag *
|
||||
std::unique_ptr<Tag>
|
||||
vorbis_comments_to_tag(char **comments) noexcept
|
||||
{
|
||||
TagBuilder tag_builder;
|
||||
vorbis_comments_scan(comments, add_tag_handler, &tag_builder);
|
||||
return tag_builder.empty()
|
||||
? nullptr
|
||||
: tag_builder.CommitNew().release();
|
||||
: tag_builder.CommitNew();
|
||||
}
|
||||
|
@@ -22,6 +22,8 @@
|
||||
|
||||
#include "check.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
struct ReplayGainInfo;
|
||||
struct TagHandler;
|
||||
struct Tag;
|
||||
@@ -33,7 +35,7 @@ void
|
||||
vorbis_comments_scan(char **comments,
|
||||
const TagHandler &handler, void *handler_ctx);
|
||||
|
||||
Tag *
|
||||
std::unique_ptr<Tag>
|
||||
vorbis_comments_to_tag(char **comments) noexcept;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user