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
0f843326
Commit
0f843326
authored
Oct 23, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: make "mode" const
parent
46c82259
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+24
-15
No files found.
src/output/plugins/AlsaOutputPlugin.cxx
View file @
0f843326
...
...
@@ -93,7 +93,7 @@ class AlsaOutput final
const
unsigned
period_time
;
/** the mode flags passed to snd_pcm_open */
int
mode
=
0
;
const
int
mode
;
std
::
forward_list
<
Alsa
::
AllowedFormat
>
allowed_formats
;
...
...
@@ -408,21 +408,11 @@ private:
static
constexpr
Domain
alsa_output_domain
(
"alsa_output"
);
AlsaOutput
::
AlsaOutput
(
EventLoop
&
_loop
,
const
ConfigBlock
&
block
)
:
AudioOutput
(
FLAG_ENABLE_DISABLE
),
MultiSocketMonitor
(
_loop
),
defer_invalidate_sockets
(
_loop
,
BIND_THIS_METHOD
(
InvalidateSockets
)),
silence_timer
(
_loop
,
BIND_THIS_METHOD
(
OnSilenceTimer
)),
device
(
block
.
GetBlockValue
(
"device"
,
""
)),
#ifdef ENABLE_DSD
dop_setting
(
block
.
GetBlockValue
(
"dop"
,
false
)
||
/* legacy name from MPD 0.18 and older: */
block
.
GetBlockValue
(
"dsd_usb"
,
false
)),
#endif
buffer_time
(
block
.
GetPositiveValue
(
"buffer_time"
,
MPD_ALSA_BUFFER_TIME_US
)),
period_time
(
block
.
GetPositiveValue
(
"period_time"
,
0U
))
static
int
GetAlsaOpenMode
(
const
ConfigBlock
&
block
)
{
int
mode
=
0
;
#ifdef SND_PCM_NO_AUTO_RESAMPLE
if
(
!
block
.
GetBlockValue
(
"auto_resample"
,
true
))
mode
|=
SND_PCM_NO_AUTO_RESAMPLE
;
...
...
@@ -438,6 +428,25 @@ AlsaOutput::AlsaOutput(EventLoop &_loop, const ConfigBlock &block)
mode
|=
SND_PCM_NO_AUTO_FORMAT
;
#endif
return
mode
;
}
AlsaOutput
::
AlsaOutput
(
EventLoop
&
_loop
,
const
ConfigBlock
&
block
)
:
AudioOutput
(
FLAG_ENABLE_DISABLE
),
MultiSocketMonitor
(
_loop
),
defer_invalidate_sockets
(
_loop
,
BIND_THIS_METHOD
(
InvalidateSockets
)),
silence_timer
(
_loop
,
BIND_THIS_METHOD
(
OnSilenceTimer
)),
device
(
block
.
GetBlockValue
(
"device"
,
""
)),
#ifdef ENABLE_DSD
dop_setting
(
block
.
GetBlockValue
(
"dop"
,
false
)
||
/* legacy name from MPD 0.18 and older: */
block
.
GetBlockValue
(
"dsd_usb"
,
false
)),
#endif
buffer_time
(
block
.
GetPositiveValue
(
"buffer_time"
,
MPD_ALSA_BUFFER_TIME_US
)),
period_time
(
block
.
GetPositiveValue
(
"period_time"
,
0U
)),
mode
(
GetAlsaOpenMode
(
block
))
{
const
char
*
allowed_formats_string
=
block
.
GetBlockValue
(
"allowed_formats"
,
nullptr
);
if
(
allowed_formats_string
!=
nullptr
)
...
...
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