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
58a5da33
Commit
58a5da33
authored
Dec 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OutputPlugin: pass Tag reference to _send_tag()
parent
7077eac5
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
19 deletions
+17
-19
OutputPlugin.cxx
src/output/OutputPlugin.cxx
+1
-1
OutputPlugin.hxx
src/output/OutputPlugin.hxx
+2
-2
OutputThread.cxx
src/output/OutputThread.cxx
+1
-1
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+2
-2
RoarOutputPlugin.cxx
src/output/plugins/RoarOutputPlugin.cxx
+2
-2
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+4
-4
HttpdInternal.hxx
src/output/plugins/httpd/HttpdInternal.hxx
+1
-1
HttpdOutputPlugin.cxx
src/output/plugins/httpd/HttpdOutputPlugin.cxx
+4
-6
No files found.
src/output/OutputPlugin.cxx
View file @
58a5da33
...
...
@@ -75,7 +75,7 @@ ao_plugin_delay(AudioOutput *ao)
}
void
ao_plugin_send_tag
(
AudioOutput
*
ao
,
const
Tag
*
tag
)
ao_plugin_send_tag
(
AudioOutput
*
ao
,
const
Tag
&
tag
)
{
if
(
ao
->
plugin
.
send_tag
!=
nullptr
)
ao
->
plugin
.
send_tag
(
ao
,
tag
);
...
...
src/output/OutputPlugin.hxx
View file @
58a5da33
...
...
@@ -107,7 +107,7 @@ struct AudioOutputPlugin {
* Display metadata for the next chunk. Optional method,
* because not all devices can display metadata.
*/
void
(
*
send_tag
)(
AudioOutput
*
data
,
const
Tag
*
tag
);
void
(
*
send_tag
)(
AudioOutput
*
data
,
const
Tag
&
tag
);
/**
* Play a chunk of audio data.
...
...
@@ -186,7 +186,7 @@ unsigned
ao_plugin_delay
(
AudioOutput
*
ao
);
void
ao_plugin_send_tag
(
AudioOutput
*
ao
,
const
Tag
*
tag
);
ao_plugin_send_tag
(
AudioOutput
*
ao
,
const
Tag
&
tag
);
size_t
ao_plugin_play
(
AudioOutput
*
ao
,
const
void
*
chunk
,
size_t
size
,
...
...
src/output/OutputThread.cxx
View file @
58a5da33
...
...
@@ -455,7 +455,7 @@ AudioOutput::PlayChunk(const MusicChunk *chunk)
if
(
tags
&&
gcc_unlikely
(
chunk
->
tag
!=
nullptr
))
{
mutex
.
unlock
();
ao_plugin_send_tag
(
this
,
chunk
->
tag
);
ao_plugin_send_tag
(
this
,
*
chunk
->
tag
);
mutex
.
lock
();
}
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
58a5da33
...
...
@@ -257,11 +257,11 @@ RecorderOutput::SendTag(const Tag &tag)
}
static
void
recorder_output_send_tag
(
AudioOutput
*
ao
,
const
Tag
*
tag
)
recorder_output_send_tag
(
AudioOutput
*
ao
,
const
Tag
&
tag
)
{
RecorderOutput
&
recorder
=
*
(
RecorderOutput
*
)
ao
;
recorder
.
SendTag
(
*
tag
);
recorder
.
SendTag
(
tag
);
}
static
size_t
...
...
src/output/plugins/RoarOutputPlugin.cxx
View file @
58a5da33
...
...
@@ -407,10 +407,10 @@ RoarOutput::SendTag(const Tag &tag)
}
static
void
roar_send_tag
(
AudioOutput
*
ao
,
const
Tag
*
meta
)
roar_send_tag
(
AudioOutput
*
ao
,
const
Tag
&
meta
)
{
RoarOutput
*
self
=
(
RoarOutput
*
)
ao
;
self
->
SendTag
(
*
meta
);
self
->
SendTag
(
meta
);
}
const
struct
AudioOutputPlugin
roar_output_plugin
=
{
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
58a5da33
...
...
@@ -462,7 +462,7 @@ my_shout_pause(AudioOutput *ao)
}
static
void
shout_tag_to_metadata
(
const
Tag
*
tag
,
char
*
dest
,
size_t
size
)
shout_tag_to_metadata
(
const
Tag
&
tag
,
char
*
dest
,
size_t
size
)
{
char
artist
[
size
];
char
title
[
size
];
...
...
@@ -470,7 +470,7 @@ shout_tag_to_metadata(const Tag *tag, char *dest, size_t size)
artist
[
0
]
=
0
;
title
[
0
]
=
0
;
for
(
const
auto
&
item
:
*
tag
)
{
for
(
const
auto
&
item
:
tag
)
{
switch
(
item
.
type
)
{
case
TAG_ARTIST
:
strncpy
(
artist
,
item
.
value
,
size
);
...
...
@@ -488,7 +488,7 @@ shout_tag_to_metadata(const Tag *tag, char *dest, size_t size)
}
static
void
my_shout_set_tag
(
AudioOutput
*
ao
,
const
Tag
*
tag
)
const
Tag
&
tag
)
{
ShoutOutput
*
sd
=
(
ShoutOutput
*
)
ao
;
...
...
@@ -498,7 +498,7 @@ static void my_shout_set_tag(AudioOutput *ao,
Error
error
;
if
(
!
encoder_pre_tag
(
sd
->
encoder
,
error
)
||
!
write_page
(
sd
,
error
)
||
!
encoder_tag
(
sd
->
encoder
,
tag
,
error
))
{
!
encoder_tag
(
sd
->
encoder
,
&
tag
,
error
))
{
LogError
(
error
);
return
;
}
...
...
src/output/plugins/httpd/HttpdInternal.hxx
View file @
58a5da33
...
...
@@ -250,7 +250,7 @@ public:
bool
EncodeAndPlay
(
const
void
*
chunk
,
size_t
size
,
Error
&
error
);
void
SendTag
(
const
Tag
*
tag
);
void
SendTag
(
const
Tag
&
tag
);
size_t
Play
(
const
void
*
chunk
,
size_t
size
,
Error
&
error
);
...
...
src/output/plugins/httpd/HttpdOutputPlugin.cxx
View file @
58a5da33
...
...
@@ -499,10 +499,8 @@ httpd_output_pause(AudioOutput *ao)
}
inline
void
HttpdOutput
::
SendTag
(
const
Tag
*
tag
)
HttpdOutput
::
SendTag
(
const
Tag
&
tag
)
{
assert
(
tag
!=
nullptr
);
if
(
encoder
->
plugin
.
tag
!=
nullptr
)
{
/* embed encoder tags */
...
...
@@ -514,7 +512,7 @@ HttpdOutput::SendTag(const Tag *tag)
/* send the tag to the encoder - which starts a new
stream now */
encoder_tag
(
encoder
,
tag
,
IgnoreError
());
encoder_tag
(
encoder
,
&
tag
,
IgnoreError
());
/* the first page generated by the encoder will now be
used as the new "header" page, which is sent to all
...
...
@@ -538,7 +536,7 @@ HttpdOutput::SendTag(const Tag *tag)
TAG_NUM_OF_ITEM_TYPES
};
metadata
=
icy_server_metadata_page
(
*
tag
,
&
types
[
0
]);
metadata
=
icy_server_metadata_page
(
tag
,
&
types
[
0
]);
if
(
metadata
!=
nullptr
)
{
const
ScopeLock
protect
(
mutex
);
for
(
auto
&
client
:
clients
)
...
...
@@ -548,7 +546,7 @@ HttpdOutput::SendTag(const Tag *tag)
}
static
void
httpd_output_tag
(
AudioOutput
*
ao
,
const
Tag
*
tag
)
httpd_output_tag
(
AudioOutput
*
ao
,
const
Tag
&
tag
)
{
HttpdOutput
*
httpd
=
HttpdOutput
::
Cast
(
ao
);
...
...
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