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
e463244d
Commit
e463244d
authored
Aug 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: move alsa_configure() into the class
parent
9e10b75f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+15
-13
No files found.
src/output/plugins/AlsaOutputPlugin.cxx
View file @
e463244d
...
...
@@ -129,6 +129,8 @@ struct AlsaOutput {
bool
Init
(
const
config_param
&
param
,
Error
&
error
)
{
return
base
.
Configure
(
param
,
error
);
}
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
};
static
constexpr
Domain
alsa_output_domain
(
"alsa_output"
);
...
...
@@ -139,33 +141,35 @@ alsa_device(const AlsaOutput *ad)
return
ad
->
device
.
empty
()
?
default_device
:
ad
->
device
.
c_str
();
}
static
void
alsa_configure
(
AlsaOutput
*
ad
,
const
config_param
&
param
)
inline
bool
AlsaOutput
::
Configure
(
const
config_param
&
param
,
gcc_unused
Error
&
error
)
{
ad
->
device
=
param
.
GetBlockValue
(
"device"
,
""
);
device
=
param
.
GetBlockValue
(
"device"
,
""
);
ad
->
use_mmap
=
param
.
GetBlockValue
(
"use_mmap"
,
false
);
use_mmap
=
param
.
GetBlockValue
(
"use_mmap"
,
false
);
ad
->
dsd_usb
=
param
.
GetBlockValue
(
"dsd_usb"
,
false
);
dsd_usb
=
param
.
GetBlockValue
(
"dsd_usb"
,
false
);
ad
->
buffer_time
=
param
.
GetBlockValue
(
"buffer_time"
,
buffer_time
=
param
.
GetBlockValue
(
"buffer_time"
,
MPD_ALSA_BUFFER_TIME_US
);
ad
->
period_time
=
param
.
GetBlockValue
(
"period_time"
,
0u
);
period_time
=
param
.
GetBlockValue
(
"period_time"
,
0u
);
#ifdef SND_PCM_NO_AUTO_RESAMPLE
if
(
!
param
.
GetBlockValue
(
"auto_resample"
,
true
))
ad
->
mode
|=
SND_PCM_NO_AUTO_RESAMPLE
;
mode
|=
SND_PCM_NO_AUTO_RESAMPLE
;
#endif
#ifdef SND_PCM_NO_AUTO_CHANNELS
if
(
!
param
.
GetBlockValue
(
"auto_channels"
,
true
))
ad
->
mode
|=
SND_PCM_NO_AUTO_CHANNELS
;
mode
|=
SND_PCM_NO_AUTO_CHANNELS
;
#endif
#ifdef SND_PCM_NO_AUTO_FORMAT
if
(
!
param
.
GetBlockValue
(
"auto_format"
,
true
))
ad
->
mode
|=
SND_PCM_NO_AUTO_FORMAT
;
mode
|=
SND_PCM_NO_AUTO_FORMAT
;
#endif
return
true
;
}
static
AudioOutput
*
...
...
@@ -173,13 +177,11 @@ alsa_init(const config_param ¶m, Error &error)
{
AlsaOutput
*
ad
=
new
AlsaOutput
();
if
(
!
ad
->
Init
(
param
,
error
))
{
if
(
!
ad
->
Init
(
param
,
error
)
||
!
ad
->
Configure
(
param
,
error
)
)
{
delete
ad
;
return
nullptr
;
}
alsa_configure
(
ad
,
param
);
return
&
ad
->
base
;
}
...
...
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