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
7d69cbbd
Commit
7d69cbbd
authored
Aug 05, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Tag: Merge() returns Tag, MergePtr() returns std::unique_ptr<Tag>
parent
955502f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
Bridge.cxx
src/decoder/Bridge.cxx
+3
-3
IcyInputStream.cxx
src/input/IcyInputStream.cxx
+1
-1
Tag.cxx
src/tag/Tag.cxx
+10
-2
Tag.hxx
src/tag/Tag.hxx
+5
-2
No files found.
src/decoder/Bridge.cxx
View file @
7d69cbbd
...
...
@@ -474,8 +474,8 @@ DecoderBridge::SubmitData(InputStream *is,
if
(
UpdateStreamTag
(
is
))
{
if
(
decoder_tag
!=
nullptr
)
/* merge with tag from decoder plugin */
cmd
=
DoSendTag
(
*
Tag
::
Merge
(
*
decoder_tag
,
*
stream_tag
));
cmd
=
DoSendTag
(
Tag
::
Merge
(
*
decoder_tag
,
*
stream_tag
));
else
/* send only the stream tag */
cmd
=
DoSendTag
(
*
stream_tag
);
...
...
@@ -598,7 +598,7 @@ DecoderBridge::SubmitTag(InputStream *is, Tag &&tag) noexcept
if
(
stream_tag
!=
nullptr
)
/* merge with tag from input stream */
cmd
=
DoSendTag
(
*
Tag
::
Merge
(
*
stream_tag
,
*
decoder_tag
));
cmd
=
DoSendTag
(
Tag
::
Merge
(
*
stream_tag
,
*
decoder_tag
));
else
/* send only the decoder tag */
cmd
=
DoSendTag
(
*
decoder_tag
);
...
...
src/input/IcyInputStream.cxx
View file @
7d69cbbd
...
...
@@ -92,7 +92,7 @@ IcyInputStream::ReadTag() noexcept
if
(
icy_tag
==
nullptr
)
return
std
::
make_unique
<
Tag
>
(
*
input_tag
);
return
Tag
::
Merge
(
*
input_tag
,
*
icy_tag
);
return
Tag
::
Merge
Ptr
(
*
input_tag
,
*
icy_tag
);
}
size_t
...
...
src/tag/Tag.cxx
View file @
7d69cbbd
...
...
@@ -53,11 +53,19 @@ Tag::Tag(const Tag &other) noexcept
}
}
std
::
unique_ptr
<
Tag
>
Tag
Tag
::
Merge
(
const
Tag
&
base
,
const
Tag
&
add
)
noexcept
{
TagBuilder
builder
(
add
);
builder
.
Complement
(
base
);
return
builder
.
Commit
();
}
std
::
unique_ptr
<
Tag
>
Tag
::
MergePtr
(
const
Tag
&
base
,
const
Tag
&
add
)
noexcept
{
TagBuilder
builder
(
add
);
builder
.
Complement
(
base
);
return
builder
.
CommitNew
();
}
...
...
@@ -70,7 +78,7 @@ Tag::Merge(std::unique_ptr<Tag> base, std::unique_ptr<Tag> add) noexcept
if
(
base
==
nullptr
)
return
add
;
return
Merge
(
*
base
,
*
add
);
return
Merge
Ptr
(
*
base
,
*
add
);
}
const
char
*
...
...
src/tag/Tag.hxx
View file @
7d69cbbd
...
...
@@ -117,8 +117,11 @@ struct Tag {
*
* @return a newly allocated tag
*/
static
std
::
unique_ptr
<
Tag
>
Merge
(
const
Tag
&
base
,
const
Tag
&
add
)
noexcept
;
static
Tag
Merge
(
const
Tag
&
base
,
const
Tag
&
add
)
noexcept
;
static
std
::
unique_ptr
<
Tag
>
MergePtr
(
const
Tag
&
base
,
const
Tag
&
add
)
noexcept
;
/**
* Merges the data from two tags. Any of the two may be nullptr. Both
...
...
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