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
99e6409a
Commit
99e6409a
authored
Dec 29, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{mixer,output}/pulse: move code to LogPulseError()
parent
6a0a5f96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
13 deletions
+71
-13
Makefile.am
Makefile.am
+1
-0
LogError.cxx
src/lib/pulse/LogError.cxx
+33
-0
LogError.hxx
src/lib/pulse/LogError.hxx
+28
-0
PulseMixerPlugin.cxx
src/mixer/plugins/PulseMixerPlugin.cxx
+5
-7
PulseOutputPlugin.cxx
src/output/plugins/PulseOutputPlugin.cxx
+4
-6
No files found.
Makefile.am
View file @
99e6409a
...
...
@@ -1351,6 +1351,7 @@ libmixer_plugins_a_SOURCES += \
noinst_LIBRARIES
+=
libpulse.a
libpulse_a_SOURCES
=
\
src/lib/pulse/LogError.cxx src/lib/pulse/LogError.hxx
\
src/lib/pulse/Error.cxx src/lib/pulse/Error.hxx
\
src/lib/pulse/Domain.cxx src/lib/pulse/Domain.hxx
libpulse_a_CPPFLAGS
=
$(AM_CPPFLAGS)
$(PULSE_CFLAGS)
...
...
src/lib/pulse/LogError.cxx
0 → 100644
View file @
99e6409a
/*
* Copyright (C) 2003-2014 The Music Player Daemon Project
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "LogError.hxx"
#include "Domain.hxx"
#include "Log.hxx"
#include <pulse/context.h>
#include <pulse/error.h>
void
LogPulseError
(
pa_context
*
context
,
const
char
*
prefix
)
{
const
int
e
=
pa_context_errno
(
context
);
FormatError
(
pulse_domain
,
"%s: %s"
,
prefix
,
pa_strerror
(
e
));
}
src/lib/pulse/LogError.hxx
0 → 100644
View file @
99e6409a
/*
* Copyright (C) 2003-2014 The Music Player Daemon Project
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_PULSE_LOG_ERROR_HXX
#define MPD_PULSE_LOG_ERROR_HXX
struct
pa_context
;
void
LogPulseError
(
pa_context
*
context
,
const
char
*
prefix
);
#endif
src/mixer/plugins/PulseMixerPlugin.cxx
View file @
99e6409a
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "PulseMixerPlugin.hxx"
#include "lib/pulse/Domain.hxx"
#include "lib/pulse/LogError.hxx"
#include "mixer/MixerInternal.hxx"
#include "mixer/Listener.hxx"
#include "output/plugins/PulseOutputPlugin.hxx"
...
...
@@ -30,7 +31,6 @@
#include <pulse/introspect.h>
#include <pulse/stream.h>
#include <pulse/subscribe.h>
#include <pulse/error.h>
#include <assert.h>
...
...
@@ -118,9 +118,8 @@ PulseMixer::Update(pa_context *context, pa_stream *stream)
pa_stream_get_index
(
stream
),
pulse_mixer_volume_cb
,
this
);
if
(
o
==
nullptr
)
{
FormatError
(
pulse_domain
,
"pa_context_get_sink_input_info() failed: %s"
,
pa_strerror
(
pa_context_errno
(
context
)));
LogPulseError
(
context
,
"pa_context_get_sink_input_info() failed"
);
Offline
();
return
;
}
...
...
@@ -140,9 +139,8 @@ pulse_mixer_on_connect(gcc_unused PulseMixer &pm,
(
pa_subscription_mask_t
)
PA_SUBSCRIPTION_MASK_SINK_INPUT
,
nullptr
,
nullptr
);
if
(
o
==
nullptr
)
{
FormatError
(
pulse_domain
,
"pa_context_subscribe() failed: %s"
,
pa_strerror
(
pa_context_errno
(
context
)));
LogPulseError
(
context
,
"pa_context_subscribe() failed"
);
return
;
}
...
...
src/output/plugins/PulseOutputPlugin.cxx
View file @
99e6409a
...
...
@@ -21,6 +21,7 @@
#include "PulseOutputPlugin.hxx"
#include "lib/pulse/Domain.hxx"
#include "lib/pulse/Error.hxx"
#include "lib/pulse/LogError.hxx"
#include "../OutputAPI.hxx"
#include "mixer/MixerList.hxx"
#include "mixer/plugins/PulseMixerPlugin.hxx"
...
...
@@ -618,9 +619,8 @@ pulse_output_close(AudioOutput *ao)
o
=
pa_stream_drain
(
po
->
stream
,
pulse_output_stream_success_cb
,
po
);
if
(
o
==
nullptr
)
{
FormatWarning
(
pulse_domain
,
"pa_stream_drain() has failed: %s"
,
pa_strerror
(
pa_context_errno
(
po
->
context
)));
LogPulseError
(
po
->
context
,
"pa_stream_drain() has failed"
);
}
else
pulse_wait_for_operation
(
po
->
mainloop
,
o
);
}
...
...
@@ -797,9 +797,7 @@ pulse_output_cancel(AudioOutput *ao)
o
=
pa_stream_flush
(
po
->
stream
,
pulse_output_stream_success_cb
,
po
);
if
(
o
==
nullptr
)
{
FormatWarning
(
pulse_domain
,
"pa_stream_flush() has failed: %s"
,
pa_strerror
(
pa_context_errno
(
po
->
context
)));
LogPulseError
(
po
->
context
,
"pa_stream_flush() has failed"
);
pa_threaded_mainloop_unlock
(
po
->
mainloop
);
return
;
}
...
...
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