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
cbd38327
Commit
cbd38327
authored
Jul 31, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderAPI: pass rvalue reference to decoder_tag()
Avoid duplicating the tag.
parent
06f898cc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
14 deletions
+13
-14
DecoderAPI.cxx
src/DecoderAPI.cxx
+3
-4
DecoderAPI.hxx
src/DecoderAPI.hxx
+1
-2
FlacDecoderPlugin.cxx
src/decoder/FlacDecoderPlugin.cxx
+1
-1
MadDecoderPlugin.cxx
src/decoder/MadDecoderPlugin.cxx
+3
-2
OpusDecoderPlugin.cxx
src/decoder/OpusDecoderPlugin.cxx
+1
-1
VorbisDecoderPlugin.cxx
src/decoder/VorbisDecoderPlugin.cxx
+1
-1
dump_playlist.cxx
test/dump_playlist.cxx
+1
-1
read_tags.cxx
test/read_tags.cxx
+1
-1
run_decoder.cxx
test/run_decoder.cxx
+1
-1
No files found.
src/DecoderAPI.cxx
View file @
cbd38327
...
...
@@ -471,19 +471,18 @@ decoder_data(struct decoder *decoder,
enum
decoder_command
decoder_tag
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
Tag
*
tag
)
Tag
&&
tag
)
{
G_GNUC_UNUSED
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
enum
decoder_command
cmd
;
assert
(
dc
->
state
==
DECODE_STATE_DECODE
);
assert
(
dc
->
pipe
!=
NULL
);
assert
(
tag
!=
NULL
);
/* save the tag */
delete
decoder
->
decoder_tag
;
decoder
->
decoder_tag
=
new
Tag
(
*
tag
);
decoder
->
decoder_tag
=
new
Tag
(
tag
);
/* check for a new stream tag */
...
...
@@ -509,7 +508,7 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
delete
merged
;
}
else
/* send only the decoder tag */
cmd
=
do_send_tag
(
decoder
,
*
tag
);
cmd
=
do_send_tag
(
decoder
,
*
decoder
->
decoder_
tag
);
return
cmd
;
}
...
...
src/DecoderAPI.hxx
View file @
cbd38327
...
...
@@ -141,8 +141,7 @@ decoder_data(struct decoder *decoder, struct input_stream *is,
* command pending
*/
enum
decoder_command
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
Tag
*
tag
);
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
Tag
&&
tag
);
/**
* Set replay gain values for the following chunks.
...
...
src/decoder/FlacDecoderPlugin.cxx
View file @
cbd38327
...
...
@@ -174,7 +174,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
while
(
true
)
{
if
(
data
->
tag
!=
nullptr
&&
!
data
->
tag
->
IsEmpty
())
{
cmd
=
decoder_tag
(
data
->
decoder
,
data
->
input_stream
,
data
->
tag
);
std
::
move
(
*
data
->
tag
)
);
delete
data
->
tag
;
data
->
tag
=
new
Tag
();
}
else
...
...
src/decoder/MadDecoderPlugin.cxx
View file @
cbd38327
...
...
@@ -1084,7 +1084,8 @@ MadDecoder::Read()
ret
=
DecodeNextFrameHeader
(
&
tag
);
if
(
tag
!=
nullptr
)
{
decoder_tag
(
decoder
,
input_stream
,
tag
);
decoder_tag
(
decoder
,
input_stream
,
std
::
move
(
*
tag
));
delete
tag
;
}
}
while
(
ret
==
DECODE_CONT
);
...
...
@@ -1142,7 +1143,7 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
data
.
total_time
);
if
(
tag
!=
nullptr
)
{
decoder_tag
(
decoder
,
input_stream
,
tag
);
decoder_tag
(
decoder
,
input_stream
,
std
::
move
(
*
tag
)
);
delete
tag
;
}
...
...
src/decoder/OpusDecoderPlugin.cxx
View file @
cbd38327
...
...
@@ -228,7 +228,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
if
(
ScanOpusTags
(
packet
.
packet
,
packet
.
bytes
,
&
add_tag_handler
,
&
tag
)
&&
!
tag
.
IsEmpty
())
cmd
=
decoder_tag
(
decoder
,
input_stream
,
&
tag
);
cmd
=
decoder_tag
(
decoder
,
input_stream
,
std
::
move
(
tag
)
);
else
cmd
=
decoder_get_command
(
decoder
);
...
...
src/decoder/VorbisDecoderPlugin.cxx
View file @
cbd38327
...
...
@@ -158,7 +158,7 @@ vorbis_send_comments(struct decoder *decoder, struct input_stream *is,
if
(
!
tag
)
return
;
decoder_tag
(
decoder
,
is
,
tag
);
decoder_tag
(
decoder
,
is
,
std
::
move
(
*
tag
)
);
delete
tag
;
}
...
...
test/dump_playlist.cxx
View file @
cbd38327
...
...
@@ -106,7 +106,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder,
enum
decoder_command
decoder_tag
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
struct
input_stream
*
is
,
G_GNUC_UNUSED
const
Tag
*
tag
)
G_GNUC_UNUSED
Tag
&&
tag
)
{
return
DECODE_COMMAND_NONE
;
}
...
...
test/read_tags.cxx
View file @
cbd38327
...
...
@@ -92,7 +92,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder,
enum
decoder_command
decoder_tag
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
struct
input_stream
*
is
,
G_GNUC_UNUSED
const
Tag
*
tag
)
G_GNUC_UNUSED
Tag
&&
tag
)
{
return
DECODE_COMMAND_NONE
;
}
...
...
test/run_decoder.cxx
View file @
cbd38327
...
...
@@ -113,7 +113,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder,
enum
decoder_command
decoder_tag
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
struct
input_stream
*
is
,
G_GNUC_UNUSED
const
Tag
*
tag
)
G_GNUC_UNUSED
Tag
&&
tag
)
{
return
DECODE_COMMAND_NONE
;
}
...
...
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