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
0cf4f09e
Commit
0cf4f09e
authored
Feb 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output_api: removed audio_output_get_name()
Use config_get_block_string("name") instead of audio_output_get_name().
parent
4726c7f7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
53 deletions
+14
-53
Makefile.am
Makefile.am
+0
-1
ao_plugin.c
src/output/ao_plugin.c
+2
-2
jack_plugin.c
src/output/jack_plugin.c
+4
-10
pulse_plugin.c
src/output/pulse_plugin.c
+8
-11
output_api.c
src/output_api.c
+0
-25
output_api.h
src/output_api.h
+0
-4
No files found.
Makefile.am
View file @
0cf4f09e
...
...
@@ -422,7 +422,6 @@ OUTPUT_LIBS = \
$(SHOUT_LIBS)
OUTPUT_SRC
=
\
src/output_api.c
\
src/output_list.c
\
src/output_all.c
\
src/output_thread.c
\
...
...
src/output/ao_plugin.c
View file @
0cf4f09e
...
...
@@ -75,7 +75,7 @@ static void audioOutputAo_error(const char *msg)
}
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
audioOutputAo_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
const
struct
config_param
*
param
)
{
...
...
@@ -103,7 +103,7 @@ audioOutputAo_initDriver(struct audio_output *ao,
}
g_debug
(
"using ao driver
\"
%s
\"
for
\"
%s
\"\n
"
,
ai
->
short_name
,
audio_output_get_name
(
ao
));
config_get_block_string
(
param
,
"name"
,
NULL
));
value
=
config_get_block_string
(
param
,
"options"
,
NULL
);
if
(
value
!=
NULL
)
{
...
...
src/output/jack_plugin.c
View file @
0cf4f09e
...
...
@@ -41,7 +41,7 @@ static const char *const port_names[2] = {
};
struct
jack_data
{
struct
audio_output
*
ao
;
const
char
*
name
;
/* configuration */
char
*
output_ports
[
2
];
...
...
@@ -58,12 +58,6 @@ struct jack_data {
bool
shutdown
;
};
static
const
char
*
mpd_jack_name
(
const
struct
jack_data
*
jd
)
{
return
audio_output_get_name
(
jd
->
ao
);
}
static
void
mpd_jack_client_free
(
struct
jack_data
*
jd
)
{
...
...
@@ -163,7 +157,7 @@ mpd_jack_info(const char *msg)
#endif
static
void
*
mpd_jack_init
(
struct
audio_output
*
ao
,
mpd_jack_init
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
const
struct
config_param
*
param
)
{
...
...
@@ -171,7 +165,7 @@ mpd_jack_init(struct audio_output *ao,
const
char
*
value
;
jd
=
g_new
(
struct
jack_data
,
1
);
jd
->
ao
=
ao
;
jd
->
name
=
config_get_block_string
(
param
,
"name"
,
"mpd_jack"
)
;
g_debug
(
"mpd_jack_init (pid=%d)"
,
getpid
());
...
...
@@ -221,7 +215,7 @@ mpd_jack_connect(struct jack_data *jd)
jd
->
shutdown
=
false
;
if
((
jd
->
client
=
jack_client_new
(
mpd_jack_name
(
jd
)
))
==
NULL
)
{
if
((
jd
->
client
=
jack_client_new
(
jd
->
name
))
==
NULL
)
{
g_warning
(
"jack server not running?"
);
return
false
;
}
...
...
src/output/pulse_plugin.c
View file @
0cf4f09e
...
...
@@ -25,7 +25,7 @@
#define MPD_PULSE_NAME "mpd"
struct
pulse_data
{
struct
audio_output
*
ao
;
const
char
*
name
;
pa_simple
*
s
;
char
*
server
;
...
...
@@ -53,14 +53,14 @@ static void pulse_free_data(struct pulse_data *pd)
}
static
void
*
pulse_init
(
struct
audio_output
*
ao
,
pulse_init
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
const
struct
config_param
*
param
)
{
struct
pulse_data
*
pd
;
pd
=
pulse_new_data
();
pd
->
ao
=
ao
;
pd
->
name
=
config_get_block_string
(
param
,
"name"
,
"mpd_pulse"
)
;
pd
->
server
=
param
!=
NULL
?
config_dup_block_string
(
param
,
"server"
,
NULL
)
:
NULL
;
pd
->
sink
=
param
!=
NULL
...
...
@@ -115,20 +115,19 @@ pulse_open(void *data, struct audio_format *audio_format)
ss
.
channels
=
audio_format
->
channels
;
pd
->
s
=
pa_simple_new
(
pd
->
server
,
MPD_PULSE_NAME
,
PA_STREAM_PLAYBACK
,
pd
->
sink
,
audio_output_get_name
(
pd
->
ao
)
,
pd
->
sink
,
pd
->
name
,
&
ss
,
NULL
,
NULL
,
&
error
);
if
(
!
pd
->
s
)
{
g_warning
(
"Cannot connect to server in PulseAudio output "
"
\"
%s
\"
: %s
\n
"
,
audio_output_get_name
(
pd
->
ao
),
pa_strerror
(
error
));
pd
->
name
,
pa_strerror
(
error
));
return
false
;
}
g_debug
(
"PulseAudio output
\"
%s
\"
connected and playing %i bit, %i "
"channel audio at %i Hz
\n
"
,
audio_output_get_name
(
pd
->
ao
)
,
pd
->
name
,
audio_format
->
bits
,
audio_format
->
channels
,
audio_format
->
sample_rate
);
...
...
@@ -145,8 +144,7 @@ static void pulse_cancel(void *data)
if
(
pa_simple_flush
(
pd
->
s
,
&
error
)
<
0
)
g_warning
(
"Flush failed in PulseAudio output
\"
%s
\"
: %s
\n
"
,
audio_output_get_name
(
pd
->
ao
),
pa_strerror
(
error
));
pd
->
name
,
pa_strerror
(
error
));
}
static
void
pulse_close
(
void
*
data
)
...
...
@@ -169,8 +167,7 @@ pulse_play(void *data, const void *chunk, size_t size)
if
(
pa_simple_write
(
pd
->
s
,
chunk
,
size
,
&
error
)
<
0
)
{
g_warning
(
"PulseAudio output
\"
%s
\"
disconnecting due to "
"write error: %s
\n
"
,
audio_output_get_name
(
pd
->
ao
),
pa_strerror
(
error
));
pd
->
name
,
pa_strerror
(
error
));
pulse_close
(
pd
);
return
0
;
}
...
...
src/output_api.c
deleted
100644 → 0
View file @
4726c7f7
/* the Music Player Daemon (MPD)
* Copyright (C) 2008 Max Kellermann <max@duempel.org>
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "output_api.h"
#include "output_internal.h"
const
char
*
audio_output_get_name
(
const
struct
audio_output
*
ao
)
{
return
ao
->
name
;
}
src/output_api.h
View file @
0cf4f09e
...
...
@@ -25,8 +25,4 @@
#include "tag.h"
#include "conf.h"
struct
audio_output
;
const
char
*
audio_output_get_name
(
const
struct
audio_output
*
ao
);
#endif
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