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
b29a43b4
Commit
b29a43b4
authored
Jun 25, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad, ...: more libfmt logging
parent
f60a42e0
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
193 additions
and
199 deletions
+193
-199
LogInit.cxx
src/LogInit.cxx
+1
-1
Expire.cxx
src/client/Expire.cxx
+1
-1
Service.cxx
src/db/update/Service.cxx
+4
-6
Bridge.cxx
src/decoder/Bridge.cxx
+6
-5
Thread.cxx
src/decoder/Thread.cxx
+3
-3
AdPlugDecoderPlugin.cxx
src/decoder/plugins/AdPlugDecoderPlugin.cxx
+2
-2
AudiofileDecoderPlugin.cxx
src/decoder/plugins/AudiofileDecoderPlugin.cxx
+2
-2
FlacDecoderPlugin.cxx
src/decoder/plugins/FlacDecoderPlugin.cxx
+8
-8
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+1
-1
MadDecoderPlugin.cxx
src/decoder/plugins/MadDecoderPlugin.cxx
+11
-11
PcmDecoderPlugin.cxx
src/decoder/plugins/PcmDecoderPlugin.cxx
+8
-8
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+13
-14
SndfileDecoderPlugin.cxx
src/decoder/plugins/SndfileDecoderPlugin.cxx
+3
-3
TwolameEncoderPlugin.cxx
src/encoder/plugins/TwolameEncoderPlugin.cxx
+2
-2
meson.build
src/encoder/plugins/meson.build
+1
-0
ReplayGainFilterPlugin.cxx
src/filter/plugins/ReplayGainFilterPlugin.cxx
+3
-4
meson.build
src/filter/plugins/meson.build
+1
-0
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+12
-12
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+3
-6
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+2
-1
TidalSessionManager.cxx
src/input/plugins/TidalSessionManager.cxx
+1
-1
HwSetup.cxx
src/lib/alsa/HwSetup.cxx
+6
-6
meson.build
src/lib/alsa/meson.build
+1
-0
OssMixerPlugin.cxx
src/mixer/plugins/OssMixerPlugin.cxx
+3
-3
State.cxx
src/output/State.cxx
+2
-2
AoOutputPlugin.cxx
src/output/plugins/AoOutputPlugin.cxx
+1
-1
FifoOutputPlugin.cxx
src/output/plugins/FifoOutputPlugin.cxx
+2
-2
HaikuOutputPlugin.cxx
src/output/plugins/HaikuOutputPlugin.cxx
+19
-20
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+8
-9
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+19
-19
OssOutputPlugin.cxx
src/output/plugins/OssOutputPlugin.cxx
+6
-6
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+2
-2
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+2
-2
HttpdClient.cxx
src/output/plugins/httpd/HttpdClient.cxx
+9
-9
WasapiOutputPlugin.cxx
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+11
-13
LibsamplerateResampler.cxx
src/pcm/LibsamplerateResampler.cxx
+4
-4
SoxrResampler.cxx
src/pcm/SoxrResampler.cxx
+2
-3
meson.build
src/pcm/meson.build
+1
-0
CrossFade.cxx
src/player/CrossFade.cxx
+2
-2
Playlist.cxx
src/queue/Playlist.cxx
+2
-2
PlaylistControl.cxx
src/queue/PlaylistControl.cxx
+1
-1
Bonjour.cxx
src/zeroconf/Bonjour.cxx
+2
-2
No files found.
src/LogInit.cxx
View file @
b29a43b4
...
@@ -234,7 +234,7 @@ cycle_log_files() noexcept
...
@@ -234,7 +234,7 @@ cycle_log_files() noexcept
if
(
out_path
.
IsNull
())
if
(
out_path
.
IsNull
())
return
0
;
return
0
;
Format
Debug
(
log_domain
,
"Cycling log files"
);
Log
Debug
(
log_domain
,
"Cycling log files"
);
close_log_files
();
close_log_files
();
fd
=
open_log_file
();
fd
=
open_log_file
();
...
...
src/client/Expire.cxx
View file @
b29a43b4
...
@@ -44,7 +44,7 @@ Client::OnTimeout() noexcept
...
@@ -44,7 +44,7 @@ Client::OnTimeout() noexcept
assert
(
!
idle_waiting
);
assert
(
!
idle_waiting
);
assert
(
!
background_command
);
assert
(
!
background_command
);
F
ormatDebug
(
client_domain
,
"[%u
] timeout"
,
num
);
F
mtDebug
(
client_domain
,
"[{}
] timeout"
,
num
);
}
}
Close
();
Close
();
...
...
src/db/update/Service.cxx
View file @
b29a43b4
...
@@ -113,8 +113,7 @@ UpdateService::Task() noexcept
...
@@ -113,8 +113,7 @@ UpdateService::Task() noexcept
SetThreadName
(
"update"
);
SetThreadName
(
"update"
);
if
(
!
next
.
path_utf8
.
empty
())
if
(
!
next
.
path_utf8
.
empty
())
FormatDebug
(
update_domain
,
"starting: %s"
,
FmtDebug
(
update_domain
,
"starting: {}"
,
next
.
path_utf8
);
next
.
path_utf8
.
c_str
());
else
else
LogDebug
(
update_domain
,
"starting"
);
LogDebug
(
update_domain
,
"starting"
);
...
@@ -133,8 +132,7 @@ UpdateService::Task() noexcept
...
@@ -133,8 +132,7 @@ UpdateService::Task() noexcept
}
}
if
(
!
next
.
path_utf8
.
empty
())
if
(
!
next
.
path_utf8
.
empty
())
FormatDebug
(
update_domain
,
"finished: %s"
,
FmtDebug
(
update_domain
,
"finished: {}"
,
next
.
path_utf8
);
next
.
path_utf8
.
c_str
());
else
else
LogDebug
(
update_domain
,
"finished"
);
LogDebug
(
update_domain
,
"finished"
);
...
@@ -155,8 +153,8 @@ UpdateService::StartThread(UpdateQueueItem &&i)
...
@@ -155,8 +153,8 @@ UpdateService::StartThread(UpdateQueueItem &&i)
update_thread
.
Start
();
update_thread
.
Start
();
F
orma
tDebug
(
update_domain
,
F
m
tDebug
(
update_domain
,
"spawned thread for update job id %i
"
,
next
.
id
);
"spawned thread for update job id {}
"
,
next
.
id
);
}
}
unsigned
unsigned
...
...
src/decoder/Bridge.cxx
View file @
b29a43b4
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "DecoderAPI.hxx"
#include "DecoderAPI.hxx"
#include "Domain.hxx"
#include "Domain.hxx"
#include "Control.hxx"
#include "Control.hxx"
#include "lib/fmt/AudioFormatFormatter.hxx"
#include "song/DetachedSong.hxx"
#include "song/DetachedSong.hxx"
#include "pcm/Convert.hxx"
#include "pcm/Convert.hxx"
#include "MusicPipe.hxx"
#include "MusicPipe.hxx"
...
@@ -268,9 +269,9 @@ DecoderBridge::Ready(const AudioFormat audio_format,
...
@@ -268,9 +269,9 @@ DecoderBridge::Ready(const AudioFormat audio_format,
assert
(
decoder_tag
==
nullptr
);
assert
(
decoder_tag
==
nullptr
);
assert
(
!
seeking
);
assert
(
!
seeking
);
F
ormatDebug
(
decoder_domain
,
"audio_format=%s, seekable=%s
"
,
F
mtDebug
(
decoder_domain
,
"audio_format={}, seekable={}
"
,
ToString
(
audio_format
).
c_str
()
,
audio_format
,
seekable
?
"true"
:
"false"
);
seekable
);
{
{
const
std
::
lock_guard
<
Mutex
>
protect
(
dc
.
mutex
);
const
std
::
lock_guard
<
Mutex
>
protect
(
dc
.
mutex
);
...
@@ -278,8 +279,8 @@ DecoderBridge::Ready(const AudioFormat audio_format,
...
@@ -278,8 +279,8 @@ DecoderBridge::Ready(const AudioFormat audio_format,
}
}
if
(
dc
.
in_audio_format
!=
dc
.
out_audio_format
)
{
if
(
dc
.
in_audio_format
!=
dc
.
out_audio_format
)
{
F
orma
tDebug
(
decoder_domain
,
"converting to %s"
,
F
m
tDebug
(
decoder_domain
,
"converting to %s"
,
ToString
(
dc
.
out_audio_format
).
c_str
()
);
dc
.
out_audio_format
);
try
{
try
{
convert
=
std
::
make_unique
<
PcmConvert
>
(
dc
.
in_audio_format
,
convert
=
std
::
make_unique
<
PcmConvert
>
(
dc
.
in_audio_format
,
...
...
src/decoder/Thread.cxx
View file @
b29a43b4
...
@@ -61,7 +61,7 @@ DecoderUriDecode(const DecoderPlugin &plugin,
...
@@ -61,7 +61,7 @@ DecoderUriDecode(const DecoderPlugin &plugin,
assert
(
uri
!=
nullptr
);
assert
(
uri
!=
nullptr
);
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
F
ormatDebug
(
decoder_thread_domain
,
"probing plugin %s
"
,
plugin
.
name
);
F
mtDebug
(
decoder_thread_domain
,
"probing plugin {}
"
,
plugin
.
name
);
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
throw
StopDecoder
();
throw
StopDecoder
();
...
@@ -99,7 +99,7 @@ decoder_stream_decode(const DecoderPlugin &plugin,
...
@@ -99,7 +99,7 @@ decoder_stream_decode(const DecoderPlugin &plugin,
assert
(
input_stream
.
IsReady
());
assert
(
input_stream
.
IsReady
());
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
F
ormatDebug
(
decoder_thread_domain
,
"probing plugin %s
"
,
plugin
.
name
);
F
mtDebug
(
decoder_thread_domain
,
"probing plugin {}
"
,
plugin
.
name
);
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
throw
StopDecoder
();
throw
StopDecoder
();
...
@@ -142,7 +142,7 @@ decoder_file_decode(const DecoderPlugin &plugin,
...
@@ -142,7 +142,7 @@ decoder_file_decode(const DecoderPlugin &plugin,
assert
(
path
.
IsAbsolute
());
assert
(
path
.
IsAbsolute
());
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
assert
(
bridge
.
dc
.
state
==
DecoderState
::
START
);
F
ormatDebug
(
decoder_thread_domain
,
"probing plugin %s
"
,
plugin
.
name
);
F
mtDebug
(
decoder_thread_domain
,
"probing plugin {}
"
,
plugin
.
name
);
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
if
(
bridge
.
dc
.
command
==
DecoderCommand
::
STOP
)
throw
StopDecoder
();
throw
StopDecoder
();
...
...
src/decoder/plugins/AdPlugDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -38,8 +38,8 @@ static unsigned sample_rate;
...
@@ -38,8 +38,8 @@ static unsigned sample_rate;
static
bool
static
bool
adplug_init
(
const
ConfigBlock
&
block
)
adplug_init
(
const
ConfigBlock
&
block
)
{
{
F
ormatDebug
(
adplug_domain
,
"adplug %s
"
,
F
mtDebug
(
adplug_domain
,
"adplug {}
"
,
CAdPlug
::
get_version
().
c_str
());
CAdPlug
::
get_version
());
sample_rate
=
block
.
GetPositiveValue
(
"sample_rate"
,
48000U
);
sample_rate
=
block
.
GetPositiveValue
(
"sample_rate"
,
48000U
);
CheckSampleRate
(
sample_rate
);
CheckSampleRate
(
sample_rate
);
...
...
src/decoder/plugins/AudiofileDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -168,8 +168,8 @@ audiofile_setup_sample_format(AFfilehandle af_fp) noexcept
...
@@ -168,8 +168,8 @@ audiofile_setup_sample_format(AFfilehandle af_fp) noexcept
afGetSampleFormat
(
af_fp
,
AF_DEFAULT_TRACK
,
&
fs
,
&
bits
);
afGetSampleFormat
(
af_fp
,
AF_DEFAULT_TRACK
,
&
fs
,
&
bits
);
if
(
!
audio_valid_sample_format
(
audiofile_bits_to_sample_format
(
bits
)))
{
if
(
!
audio_valid_sample_format
(
audiofile_bits_to_sample_format
(
bits
)))
{
F
orma
tDebug
(
audiofile_domain
,
F
m
tDebug
(
audiofile_domain
,
"input file has
%d
bit samples, converting to 16"
,
"input file has
{}
bit samples, converting to 16"
,
bits
);
bits
);
bits
=
16
;
bits
=
16
;
}
}
...
...
src/decoder/plugins/FlacDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -73,8 +73,8 @@ flac_scan_file(Path path_fs, TagHandler &handler)
...
@@ -73,8 +73,8 @@ flac_scan_file(Path path_fs, TagHandler &handler)
{
{
FlacMetadataChain
chain
;
FlacMetadataChain
chain
;
if
(
!
chain
.
Read
(
NarrowPath
(
path_fs
)))
{
if
(
!
chain
.
Read
(
NarrowPath
(
path_fs
)))
{
F
orma
tDebug
(
flac_domain
,
F
m
tDebug
(
flac_domain
,
"Failed to read FLAC tags: %s
"
,
"Failed to read FLAC tags: {}
"
,
chain
.
GetStatusString
());
chain
.
GetStatusString
());
return
false
;
return
false
;
}
}
...
@@ -88,8 +88,8 @@ flac_scan_stream(InputStream &is, TagHandler &handler)
...
@@ -88,8 +88,8 @@ flac_scan_stream(InputStream &is, TagHandler &handler)
{
{
FlacMetadataChain
chain
;
FlacMetadataChain
chain
;
if
(
!
chain
.
Read
(
is
))
{
if
(
!
chain
.
Read
(
is
))
{
F
orma
tDebug
(
flac_domain
,
F
m
tDebug
(
flac_domain
,
"Failed to read FLAC tags: %s
"
,
"Failed to read FLAC tags: {}
"
,
chain
.
GetStatusString
());
chain
.
GetStatusString
());
return
false
;
return
false
;
}
}
...
@@ -317,8 +317,8 @@ oggflac_scan_file(Path path_fs, TagHandler &handler)
...
@@ -317,8 +317,8 @@ oggflac_scan_file(Path path_fs, TagHandler &handler)
{
{
FlacMetadataChain
chain
;
FlacMetadataChain
chain
;
if
(
!
chain
.
ReadOgg
(
NarrowPath
(
path_fs
)))
{
if
(
!
chain
.
ReadOgg
(
NarrowPath
(
path_fs
)))
{
F
orma
tDebug
(
flac_domain
,
F
m
tDebug
(
flac_domain
,
"Failed to read OggFLAC tags: %s
"
,
"Failed to read OggFLAC tags: {}
"
,
chain
.
GetStatusString
());
chain
.
GetStatusString
());
return
false
;
return
false
;
}
}
...
@@ -332,8 +332,8 @@ oggflac_scan_stream(InputStream &is, TagHandler &handler)
...
@@ -332,8 +332,8 @@ oggflac_scan_stream(InputStream &is, TagHandler &handler)
{
{
FlacMetadataChain
chain
;
FlacMetadataChain
chain
;
if
(
!
chain
.
ReadOgg
(
is
))
{
if
(
!
chain
.
ReadOgg
(
is
))
{
F
orma
tDebug
(
flac_domain
,
F
m
tDebug
(
flac_domain
,
"Failed to read OggFLAC tags: %s
"
,
"Failed to read OggFLAC tags: {}
"
,
chain
.
GetStatusString
());
chain
.
GetStatusString
());
return
false
;
return
false
;
}
}
...
...
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -160,7 +160,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
...
@@ -160,7 +160,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
AtScopeExit
(
emu
)
{
gme_delete
(
emu
);
};
AtScopeExit
(
emu
)
{
gme_delete
(
emu
);
};
F
ormatDebug
(
gme_domain
,
"emulator type '%s'
\n
"
,
F
mtDebug
(
gme_domain
,
"emulator type '{}'
"
,
gme_type_system
(
gme_type
(
emu
)));
gme_type_system
(
gme_type
(
emu
)));
#if GME_VERSION >= 0x000600
#if GME_VERSION >= 0x000600
...
...
src/decoder/plugins/MadDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -382,8 +382,8 @@ RecoverFrameError(const struct mad_stream &stream) noexcept
...
@@ -382,8 +382,8 @@ RecoverFrameError(const struct mad_stream &stream) noexcept
if
(
MAD_RECOVERABLE
(
stream
.
error
))
if
(
MAD_RECOVERABLE
(
stream
.
error
))
return
MadDecoderAction
::
SKIP
;
return
MadDecoderAction
::
SKIP
;
F
orma
tWarning
(
mad_domain
,
F
m
tWarning
(
mad_domain
,
"unrecoverable frame level error: %s
"
,
"unrecoverable frame level error: {}
"
,
mad_stream_errorstr
(
&
stream
));
mad_stream_errorstr
(
&
stream
));
return
MadDecoderAction
::
BREAK
;
return
MadDecoderAction
::
BREAK
;
}
}
...
@@ -571,7 +571,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
...
@@ -571,7 +571,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
&
lame
->
version
.
major
,
&
lame
->
version
.
minor
)
!=
2
)
&
lame
->
version
.
major
,
&
lame
->
version
.
minor
)
!=
2
)
return
false
;
return
false
;
F
ormatDebug
(
mad_domain
,
"detected LAME version %i.%i (
\"
%s
\"
)"
,
F
mtDebug
(
mad_domain
,
"detected LAME version {}.{} (
\"
{}
\"
)"
,
lame
->
version
.
major
,
lame
->
version
.
minor
,
lame
->
encoder
);
lame
->
version
.
major
,
lame
->
version
.
minor
,
lame
->
encoder
);
/* The reference volume was changed from the 83dB used in the
/* The reference volume was changed from the 83dB used in the
...
@@ -589,7 +589,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
...
@@ -589,7 +589,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
mad_bit_skip
(
ptr
,
16
);
mad_bit_skip
(
ptr
,
16
);
lame
->
peak
=
MAD_F
(
mad_bit_read
(
ptr
,
32
)
<<
5
);
/* peak */
lame
->
peak
=
MAD_F
(
mad_bit_read
(
ptr
,
32
)
<<
5
);
/* peak */
F
ormatDebug
(
mad_domain
,
"LAME peak found: %f"
,
double
(
lame
->
peak
)
);
F
mtDebug
(
mad_domain
,
"LAME peak found: {}"
,
lame
->
peak
);
lame
->
track_gain
=
0
;
lame
->
track_gain
=
0
;
unsigned
name
=
mad_bit_read
(
ptr
,
3
);
/* gain name */
unsigned
name
=
mad_bit_read
(
ptr
,
3
);
/* gain name */
...
@@ -598,8 +598,8 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
...
@@ -598,8 +598,8 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
int
gain
=
mad_bit_read
(
ptr
,
9
);
/* gain*10 */
int
gain
=
mad_bit_read
(
ptr
,
9
);
/* gain*10 */
if
(
gain
&&
name
==
1
&&
orig
!=
0
)
{
if
(
gain
&&
name
==
1
&&
orig
!=
0
)
{
lame
->
track_gain
=
((
sign
?
-
gain
:
gain
)
/
10.0
f
)
+
adj
;
lame
->
track_gain
=
((
sign
?
-
gain
:
gain
)
/
10.0
f
)
+
adj
;
F
ormatDebug
(
mad_domain
,
"LAME track gain found: %f
"
,
F
mtDebug
(
mad_domain
,
"LAME track gain found: {}
"
,
double
(
lame
->
track_gain
)
);
lame
->
track_gain
);
}
}
/* tmz reports that this isn't currently written by any version of lame
/* tmz reports that this isn't currently written by any version of lame
...
@@ -614,8 +614,8 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
...
@@ -614,8 +614,8 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
gain = mad_bit_read(ptr, 9); /* gain*10 */
gain = mad_bit_read(ptr, 9); /* gain*10 */
if (gain && name == 2 && orig != 0) {
if (gain && name == 2 && orig != 0) {
lame->album_gain = ((sign ? -gain : gain) / 10.0) + adj;
lame->album_gain = ((sign ? -gain : gain) / 10.0) + adj;
F
ormatDebug(mad_domain, "LAME album gain found: %f
",
F
mtDebug(mad_domain, "LAME album gain found: {}
",
double(lame->track_gain)
);
lame->track_gain
);
}
}
#else
#else
mad_bit_skip
(
ptr
,
16
);
mad_bit_skip
(
ptr
,
16
);
...
@@ -626,7 +626,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
...
@@ -626,7 +626,7 @@ parse_lame(struct lame *lame, struct mad_bitptr *ptr, int *bitlen) noexcept
lame
->
encoder_delay
=
mad_bit_read
(
ptr
,
12
);
lame
->
encoder_delay
=
mad_bit_read
(
ptr
,
12
);
lame
->
encoder_padding
=
mad_bit_read
(
ptr
,
12
);
lame
->
encoder_padding
=
mad_bit_read
(
ptr
,
12
);
F
ormatDebug
(
mad_domain
,
"encoder delay is %i, encoder padding is %i
"
,
F
mtDebug
(
mad_domain
,
"encoder delay is {}, encoder padding is {}
"
,
lame
->
encoder_delay
,
lame
->
encoder_padding
);
lame
->
encoder_delay
,
lame
->
encoder_padding
);
mad_bit_skip
(
ptr
,
80
);
mad_bit_skip
(
ptr
,
80
);
...
@@ -763,8 +763,8 @@ MadDecoder::DecodeFirstFrame(Tag *tag) noexcept
...
@@ -763,8 +763,8 @@ MadDecoder::DecodeFirstFrame(Tag *tag) noexcept
return
false
;
return
false
;
if
(
max_frames
>
8
*
1024
*
1024
)
{
if
(
max_frames
>
8
*
1024
*
1024
)
{
F
orma
tWarning
(
mad_domain
,
F
m
tWarning
(
mad_domain
,
"mp3 file header indicates too many frames: %zu
"
,
"mp3 file header indicates too many frames: {}
"
,
max_frames
);
max_frames
);
return
false
;
return
false
;
}
}
...
...
src/decoder/plugins/PcmDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -101,8 +101,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -101,8 +101,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
char
*
endptr
;
char
*
endptr
;
unsigned
value
=
ParseUnsigned
(
s
,
&
endptr
);
unsigned
value
=
ParseUnsigned
(
s
,
&
endptr
);
if
(
endptr
==
s
||
*
endptr
!=
0
)
{
if
(
endptr
==
s
||
*
endptr
!=
0
)
{
F
orma
tWarning
(
pcm_decoder_domain
,
F
m
tWarning
(
pcm_decoder_domain
,
"Failed to parse sample rate: %s
"
,
"Failed to parse sample rate: {}
"
,
s
);
s
);
return
;
return
;
}
}
...
@@ -123,8 +123,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -123,8 +123,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
char
*
endptr
;
char
*
endptr
;
unsigned
value
=
ParseUnsigned
(
s
,
&
endptr
);
unsigned
value
=
ParseUnsigned
(
s
,
&
endptr
);
if
(
endptr
==
s
||
*
endptr
!=
0
)
{
if
(
endptr
==
s
||
*
endptr
!=
0
)
{
F
orma
tWarning
(
pcm_decoder_domain
,
F
m
tWarning
(
pcm_decoder_domain
,
"Failed to parse sample rate: %s
"
,
"Failed to parse sample rate: {}
"
,
s
);
s
);
return
;
return
;
}
}
...
@@ -146,8 +146,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -146,8 +146,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
const
char
*
s
=
i
->
second
.
c_str
();
const
char
*
s
=
i
->
second
.
c_str
();
audio_format
=
ParseAudioFormat
(
s
,
false
);
audio_format
=
ParseAudioFormat
(
s
,
false
);
if
(
!
audio_format
.
IsFullyDefined
())
{
if
(
!
audio_format
.
IsFullyDefined
())
{
F
orma
tWarning
(
pcm_decoder_domain
,
F
m
tWarning
(
pcm_decoder_domain
,
"Invalid audio format specification: %s
"
,
"Invalid audio format specification: {}
"
,
mime
);
mime
);
return
;
return
;
}
}
...
@@ -157,8 +157,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -157,8 +157,8 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
}
}
if
(
audio_format
.
sample_rate
==
0
)
{
if
(
audio_format
.
sample_rate
==
0
)
{
F
orma
tWarning
(
pcm_decoder_domain
,
F
m
tWarning
(
pcm_decoder_domain
,
"Missing 'rate' parameter: %s
"
,
"Missing 'rate' parameter: {}
"
,
mime
);
mime
);
return
;
return
;
}
}
...
...
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -254,8 +254,7 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -254,8 +254,7 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
#else
#else
const
char
*
error
=
tune
.
getInfo
().
statusString
;
const
char
*
error
=
tune
.
getInfo
().
statusString
;
#endif
#endif
FormatWarning
(
sidplay_domain
,
"failed to load file: %s"
,
FmtWarning
(
sidplay_domain
,
"failed to load file: {}"
,
error
);
error
);
return
;
return
;
}
}
...
@@ -283,8 +282,8 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -283,8 +282,8 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
bool
error
=
player
.
load
(
&
tune
)
<
0
;
bool
error
=
player
.
load
(
&
tune
)
<
0
;
#endif
#endif
if
(
error
)
{
if
(
error
)
{
F
orma
tWarning
(
sidplay_domain
,
F
m
tWarning
(
sidplay_domain
,
"sidplay2.load() failed: %s
"
,
player
.
error
());
"sidplay2.load() failed: {}
"
,
player
.
error
());
return
;
return
;
}
}
...
@@ -293,16 +292,16 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -293,16 +292,16 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
#ifdef HAVE_SIDPLAYFP
#ifdef HAVE_SIDPLAYFP
ReSIDfpBuilder
builder
(
"ReSID"
);
ReSIDfpBuilder
builder
(
"ReSID"
);
if
(
!
builder
.
getStatus
())
{
if
(
!
builder
.
getStatus
())
{
F
orma
tWarning
(
sidplay_domain
,
F
m
tWarning
(
sidplay_domain
,
"failed to initialize ReSIDfpBuilder: %s
"
,
"failed to initialize ReSIDfpBuilder: {}
"
,
builder
.
error
());
builder
.
error
());
return
;
return
;
}
}
builder
.
create
(
player
.
info
().
maxsids
());
builder
.
create
(
player
.
info
().
maxsids
());
if
(
!
builder
.
getStatus
())
{
if
(
!
builder
.
getStatus
())
{
F
orma
tWarning
(
sidplay_domain
,
F
m
tWarning
(
sidplay_domain
,
"ReSIDfpBuilder.create() failed: %s
"
,
"ReSIDfpBuilder.create() failed: {}
"
,
builder
.
error
());
builder
.
error
());
return
;
return
;
}
}
...
@@ -310,7 +309,7 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -310,7 +309,7 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
ReSIDBuilder
builder
(
"ReSID"
);
ReSIDBuilder
builder
(
"ReSID"
);
builder
.
create
(
player
.
info
().
maxsids
);
builder
.
create
(
player
.
info
().
maxsids
);
if
(
!
builder
)
{
if
(
!
builder
)
{
F
ormatWarning
(
sidplay_domain
,
"ReSIDBuilder.create() failed: %s
"
,
F
mtWarning
(
sidplay_domain
,
"ReSIDBuilder.create() failed: {}
"
,
builder
.
error
());
builder
.
error
());
return
;
return
;
}
}
...
@@ -319,14 +318,14 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -319,14 +318,14 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
builder
.
filter
(
sidplay_global
->
filter_setting
);
builder
.
filter
(
sidplay_global
->
filter_setting
);
#ifdef HAVE_SIDPLAYFP
#ifdef HAVE_SIDPLAYFP
if
(
!
builder
.
getStatus
())
{
if
(
!
builder
.
getStatus
())
{
F
orma
tWarning
(
sidplay_domain
,
F
m
tWarning
(
sidplay_domain
,
"ReSIDfpBuilder.filter() failed: %s
"
,
"ReSIDfpBuilder.filter() failed: {}
"
,
builder
.
error
());
builder
.
error
());
return
;
return
;
}
}
#else
#else
if
(
!
builder
)
{
if
(
!
builder
)
{
F
ormatWarning
(
sidplay_domain
,
"ReSIDBuilder.filter() failed: %s
"
,
F
mtWarning
(
sidplay_domain
,
"ReSIDBuilder.filter() failed: {}
"
,
builder
.
error
());
builder
.
error
());
return
;
return
;
}
}
...
@@ -388,8 +387,8 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
...
@@ -388,8 +387,8 @@ sidplay_file_decode(DecoderClient &client, Path path_fs)
error
=
player
.
config
(
config
)
<
0
;
error
=
player
.
config
(
config
)
<
0
;
#endif
#endif
if
(
error
)
{
if
(
error
)
{
F
orma
tWarning
(
sidplay_domain
,
F
m
tWarning
(
sidplay_domain
,
"sidplay2.config() failed: %s
"
,
player
.
error
());
"sidplay2.config() failed: {}
"
,
player
.
error
());
return
;
return
;
}
}
...
...
src/decoder/plugins/SndfileDecoderPlugin.cxx
View file @
b29a43b4
...
@@ -203,7 +203,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -203,7 +203,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is)
SNDFILE
*
const
sf
=
sf_open_virtual
(
const_cast
<
SF_VIRTUAL_IO
*>
(
&
vio
),
SNDFILE
*
const
sf
=
sf_open_virtual
(
const_cast
<
SF_VIRTUAL_IO
*>
(
&
vio
),
SFM_READ
,
&
info
,
&
sis
);
SFM_READ
,
&
info
,
&
sis
);
if
(
sf
==
nullptr
)
{
if
(
sf
==
nullptr
)
{
F
ormatWarning
(
sndfile_domain
,
"sf_open_virtual() failed: %s
"
,
F
mtWarning
(
sndfile_domain
,
"sf_open_virtual() failed: {}
"
,
sf_strerror
(
nullptr
));
sf_strerror
(
nullptr
));
return
;
return
;
}
}
...
@@ -281,8 +281,8 @@ sndfile_scan_stream(InputStream &is, TagHandler &handler)
...
@@ -281,8 +281,8 @@ sndfile_scan_stream(InputStream &is, TagHandler &handler)
AtScopeExit
(
sf
)
{
sf_close
(
sf
);
};
AtScopeExit
(
sf
)
{
sf_close
(
sf
);
};
if
(
!
audio_valid_sample_rate
(
info
.
samplerate
))
{
if
(
!
audio_valid_sample_rate
(
info
.
samplerate
))
{
F
orma
tWarning
(
sndfile_domain
,
F
m
tWarning
(
sndfile_domain
,
"Invalid sample rate in %s
"
,
is
.
GetURI
());
"Invalid sample rate in {}
"
,
is
.
GetURI
());
return
false
;
return
false
;
}
}
...
...
src/encoder/plugins/TwolameEncoderPlugin.cxx
View file @
b29a43b4
...
@@ -124,8 +124,8 @@ PreparedTwolameEncoder::PreparedTwolameEncoder(const ConfigBlock &block)
...
@@ -124,8 +124,8 @@ PreparedTwolameEncoder::PreparedTwolameEncoder(const ConfigBlock &block)
static
PreparedEncoder
*
static
PreparedEncoder
*
twolame_encoder_init
(
const
ConfigBlock
&
block
)
twolame_encoder_init
(
const
ConfigBlock
&
block
)
{
{
F
orma
tDebug
(
twolame_encoder_domain
,
F
m
tDebug
(
twolame_encoder_domain
,
"libtwolame version %s
"
,
get_twolame_version
());
"libtwolame version {}
"
,
get_twolame_version
());
return
new
PreparedTwolameEncoder
(
block
);
return
new
PreparedTwolameEncoder
(
block
);
}
}
...
...
src/encoder/plugins/meson.build
View file @
b29a43b4
...
@@ -53,6 +53,7 @@ encoder_plugins = static_library(
...
@@ -53,6 +53,7 @@ encoder_plugins = static_library(
liblame_dep,
liblame_dep,
libtwolame_dep,
libtwolame_dep,
libshine_dep,
libshine_dep,
log_dep,
],
],
)
)
...
...
src/filter/plugins/ReplayGainFilterPlugin.cxx
View file @
b29a43b4
...
@@ -94,8 +94,8 @@ public:
...
@@ -94,8 +94,8 @@ public:
/* no change */
/* no change */
return
;
return
;
F
orma
tDebug
(
replay_gain_domain
,
F
m
tDebug
(
replay_gain_domain
,
"replay gain mode has changed %s->%s
\n
"
,
"replay gain mode has changed {}->{}
"
,
ToString
(
mode
),
ToString
(
_mode
));
ToString
(
mode
),
ToString
(
_mode
));
mode
=
_mode
;
mode
=
_mode
;
...
@@ -155,8 +155,7 @@ ReplayGainFilter::Update()
...
@@ -155,8 +155,7 @@ ReplayGainFilter::Update()
if
(
mode
!=
ReplayGainMode
::
OFF
)
{
if
(
mode
!=
ReplayGainMode
::
OFF
)
{
const
auto
&
tuple
=
info
.
Get
(
mode
);
const
auto
&
tuple
=
info
.
Get
(
mode
);
float
scale
=
tuple
.
CalculateScale
(
config
);
float
scale
=
tuple
.
CalculateScale
(
config
);
FormatDebug
(
replay_gain_domain
,
FmtDebug
(
replay_gain_domain
,
"scale={}
\n
"
,
scale
);
"scale=%f
\n
"
,
(
double
)
scale
);
volume
=
pcm_float_to_volume
(
scale
);
volume
=
pcm_float_to_volume
(
scale
);
}
}
...
...
src/filter/plugins/meson.build
View file @
b29a43b4
...
@@ -26,6 +26,7 @@ filter_plugins = static_library(
...
@@ -26,6 +26,7 @@ filter_plugins = static_library(
include_directories: inc,
include_directories: inc,
dependencies: [
dependencies: [
filter_plugins_deps,
filter_plugins_deps,
log_dep,
],
],
)
)
...
...
src/input/plugins/AlsaInputPlugin.cxx
View file @
b29a43b4
...
@@ -270,15 +270,15 @@ AlsaInputStream::Recover(int err)
...
@@ -270,15 +270,15 @@ AlsaInputStream::Recover(int err)
{
{
switch
(
err
)
{
switch
(
err
)
{
case
-
EPIPE
:
case
-
EPIPE
:
F
orma
tDebug
(
alsa_input_domain
,
F
m
tDebug
(
alsa_input_domain
,
"Overrun on ALSA capture device
\"
%s
\"
"
,
"Overrun on ALSA capture device
\"
{}
\"
"
,
device
.
c_str
()
);
device
);
break
;
break
;
case
-
ESTRPIPE
:
case
-
ESTRPIPE
:
F
orma
tDebug
(
alsa_input_domain
,
F
m
tDebug
(
alsa_input_domain
,
"ALSA capture device
\"
%s
\"
was suspended"
,
"ALSA capture device
\"
{}
\"
was suspended"
,
device
.
c_str
()
);
device
);
break
;
break
;
}
}
...
@@ -361,8 +361,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
...
@@ -361,8 +361,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
unsigned
buffer_time_min
,
buffer_time_max
;
unsigned
buffer_time_min
,
buffer_time_max
;
snd_pcm_hw_params_get_buffer_time_min
(
hw_params
,
&
buffer_time_min
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_min
(
hw_params
,
&
buffer_time_min
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_max
(
hw_params
,
&
buffer_time_max
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_max
(
hw_params
,
&
buffer_time_max
,
nullptr
);
F
ormatDebug
(
alsa_input_domain
,
"buffer: size=%u..%u time=%u..%u
"
,
F
mtDebug
(
alsa_input_domain
,
"buffer: size={}..{} time={}..{}
"
,
(
unsigned
)
buffer_size_min
,
(
unsigned
)
buffer_size_max
,
buffer_size_min
,
buffer_size_max
,
buffer_time_min
,
buffer_time_max
);
buffer_time_min
,
buffer_time_max
);
snd_pcm_uframes_t
period_size_min
,
period_size_max
;
snd_pcm_uframes_t
period_size_min
,
period_size_max
;
...
@@ -371,8 +371,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
...
@@ -371,8 +371,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
unsigned
period_time_min
,
period_time_max
;
unsigned
period_time_min
,
period_time_max
;
snd_pcm_hw_params_get_period_time_min
(
hw_params
,
&
period_time_min
,
nullptr
);
snd_pcm_hw_params_get_period_time_min
(
hw_params
,
&
period_time_min
,
nullptr
);
snd_pcm_hw_params_get_period_time_max
(
hw_params
,
&
period_time_max
,
nullptr
);
snd_pcm_hw_params_get_period_time_max
(
hw_params
,
&
period_time_max
,
nullptr
);
F
ormatDebug
(
alsa_input_domain
,
"period: size=%u..%u time=%u..%u
"
,
F
mtDebug
(
alsa_input_domain
,
"period: size={}..{} time={}..{}
"
,
(
unsigned
)
period_size_min
,
(
unsigned
)
period_size_max
,
period_size_min
,
period_size_max
,
period_time_min
,
period_time_max
);
period_time_min
,
period_time_max
);
/* choose the maximum possible buffer_size ... */
/* choose the maximum possible buffer_size ... */
...
@@ -409,8 +409,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
...
@@ -409,8 +409,8 @@ AlsaInputStream::ConfigureCapture(AudioFormat audio_format)
throw
FormatRuntimeError
(
"snd_pcm_hw_params_get_period_size() failed: %s"
,
throw
FormatRuntimeError
(
"snd_pcm_hw_params_get_period_size() failed: %s"
,
snd_strerror
(
-
err
));
snd_strerror
(
-
err
));
F
ormatDebug
(
alsa_input_domain
,
"buffer_size=%u period_size=%u
"
,
F
mtDebug
(
alsa_input_domain
,
"buffer_size={} period_size={}
"
,
(
unsigned
)
alsa_buffer_size
,
(
unsigned
)
alsa_period_size
);
alsa_buffer_size
,
alsa_period_size
);
snd_pcm_sw_params_t
*
sw_params
;
snd_pcm_sw_params_t
*
sw_params
;
snd_pcm_sw_params_alloca
(
&
sw_params
);
snd_pcm_sw_params_alloca
(
&
sw_params
);
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
b29a43b4
...
@@ -281,10 +281,7 @@ CurlInputStream::OnHeaders(unsigned status,
...
@@ -281,10 +281,7 @@ CurlInputStream::OnHeaders(unsigned status,
if
(
i
!=
headers
.
end
())
{
if
(
i
!=
headers
.
end
())
{
size_t
icy_metaint
=
ParseUint64
(
i
->
second
.
c_str
());
size_t
icy_metaint
=
ParseUint64
(
i
->
second
.
c_str
());
#ifndef _WIN32
FmtDebug
(
curl_domain
,
"icy-metaint={}"
,
icy_metaint
);
/* Windows doesn't know "%z" */
FormatDebug
(
curl_domain
,
"icy-metaint=%zu"
,
icy_metaint
);
#endif
if
(
icy_metaint
>
0
)
{
if
(
icy_metaint
>
0
)
{
icy
->
Start
(
icy_metaint
);
icy
->
Start
(
icy_metaint
);
...
@@ -358,9 +355,9 @@ input_curl_init(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -358,9 +355,9 @@ input_curl_init(EventLoop &event_loop, const ConfigBlock &block)
const
auto
version_info
=
curl_version_info
(
CURLVERSION_FIRST
);
const
auto
version_info
=
curl_version_info
(
CURLVERSION_FIRST
);
if
(
version_info
!=
nullptr
)
{
if
(
version_info
!=
nullptr
)
{
F
ormatDebug
(
curl_domain
,
"version %s
"
,
version_info
->
version
);
F
mtDebug
(
curl_domain
,
"version {}
"
,
version_info
->
version
);
if
(
version_info
->
features
&
CURL_VERSION_SSL
)
if
(
version_info
->
features
&
CURL_VERSION_SSL
)
F
ormatDebug
(
curl_domain
,
"with %s
"
,
F
mtDebug
(
curl_domain
,
"with {}
"
,
version_info
->
ssl_version
);
version_info
->
ssl_version
);
}
}
...
...
src/input/plugins/TidalInputPlugin.cxx
View file @
b29a43b4
...
@@ -183,7 +183,8 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -183,7 +183,8 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
if
(
password
==
nullptr
)
if
(
password
==
nullptr
)
throw
PluginUnconfigured
(
"No Tidal password configured"
);
throw
PluginUnconfigured
(
"No Tidal password configured"
);
FormatWarning
(
tidal_domain
,
"The Tidal input plugin is deprecated because Tidal has changed the protocol and doesn't share documentation"
);
LogWarning
(
tidal_domain
,
"The Tidal input plugin is deprecated because Tidal has changed the protocol and doesn't share documentation"
);
tidal_audioquality
=
block
.
GetBlockValue
(
"audioquality"
,
"HIGH"
);
tidal_audioquality
=
block
.
GetBlockValue
(
"audioquality"
,
"HIGH"
);
...
...
src/input/plugins/TidalSessionManager.cxx
View file @
b29a43b4
...
@@ -81,7 +81,7 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept
...
@@ -81,7 +81,7 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept
void
void
TidalSessionManager
::
OnTidalLoginSuccess
(
std
::
string
_session
)
noexcept
TidalSessionManager
::
OnTidalLoginSuccess
(
std
::
string
_session
)
noexcept
{
{
F
ormatDebug
(
tidal_domain
,
"Login successful, session=%s"
,
_session
.
c_str
()
);
F
mtDebug
(
tidal_domain
,
"Login successful, session={}"
,
_session
);
{
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
...
...
src/lib/alsa/HwSetup.cxx
View file @
b29a43b4
...
@@ -235,8 +235,8 @@ SetupHw(snd_pcm_t *pcm,
...
@@ -235,8 +235,8 @@ SetupHw(snd_pcm_t *pcm,
unsigned
buffer_time_min
,
buffer_time_max
;
unsigned
buffer_time_min
,
buffer_time_max
;
snd_pcm_hw_params_get_buffer_time_min
(
hwparams
,
&
buffer_time_min
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_min
(
hwparams
,
&
buffer_time_min
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_max
(
hwparams
,
&
buffer_time_max
,
nullptr
);
snd_pcm_hw_params_get_buffer_time_max
(
hwparams
,
&
buffer_time_max
,
nullptr
);
F
ormatDebug
(
alsa_output_domain
,
"buffer: size=%u..%u time=%u..%u
"
,
F
mtDebug
(
alsa_output_domain
,
"buffer: size={}..{} time={}..{}
"
,
(
unsigned
)
buffer_size_min
,
(
unsigned
)
buffer_size_max
,
buffer_size_min
,
buffer_size_max
,
buffer_time_min
,
buffer_time_max
);
buffer_time_min
,
buffer_time_max
);
snd_pcm_uframes_t
period_size_min
,
period_size_max
;
snd_pcm_uframes_t
period_size_min
,
period_size_max
;
...
@@ -245,8 +245,8 @@ SetupHw(snd_pcm_t *pcm,
...
@@ -245,8 +245,8 @@ SetupHw(snd_pcm_t *pcm,
unsigned
period_time_min
,
period_time_max
;
unsigned
period_time_min
,
period_time_max
;
snd_pcm_hw_params_get_period_time_min
(
hwparams
,
&
period_time_min
,
nullptr
);
snd_pcm_hw_params_get_period_time_min
(
hwparams
,
&
period_time_min
,
nullptr
);
snd_pcm_hw_params_get_period_time_max
(
hwparams
,
&
period_time_max
,
nullptr
);
snd_pcm_hw_params_get_period_time_max
(
hwparams
,
&
period_time_max
,
nullptr
);
F
ormatDebug
(
alsa_output_domain
,
"period: size=%u..%u time=%u..%u
"
,
F
mtDebug
(
alsa_output_domain
,
"period: size={}..{} time={}..{}
"
,
(
unsigned
)
period_size_min
,
(
unsigned
)
period_size_max
,
period_size_min
,
period_size_max
,
period_time_min
,
period_time_max
);
period_time_min
,
period_time_max
);
if
(
buffer_time
>
0
)
{
if
(
buffer_time
>
0
)
{
...
@@ -265,8 +265,8 @@ SetupHw(snd_pcm_t *pcm,
...
@@ -265,8 +265,8 @@ SetupHw(snd_pcm_t *pcm,
if
(
period_time_ro
==
0
&&
buffer_time
>=
10000
)
{
if
(
period_time_ro
==
0
&&
buffer_time
>=
10000
)
{
period_time_ro
=
period_time
=
buffer_time
/
4
;
period_time_ro
=
period_time
=
buffer_time
/
4
;
F
orma
tDebug
(
alsa_output_domain
,
F
m
tDebug
(
alsa_output_domain
,
"default period_time = buffer_time/4 = %u/4 = %u
"
,
"default period_time = buffer_time/4 = {}/4 = {}
"
,
buffer_time
,
period_time
);
buffer_time
,
period_time
);
}
}
...
...
src/lib/alsa/meson.build
View file @
b29a43b4
...
@@ -20,6 +20,7 @@ alsa = static_library(
...
@@ -20,6 +20,7 @@ alsa = static_library(
include_directories: inc,
include_directories: inc,
dependencies: [
dependencies: [
libasound_dep,
libasound_dep,
log_dep,
],
],
)
)
...
...
src/mixer/plugins/OssMixerPlugin.cxx
View file @
b29a43b4
...
@@ -153,9 +153,9 @@ OssMixer::GetVolume()
...
@@ -153,9 +153,9 @@ OssMixer::GetVolume()
right
=
(
level
&
0xff00
)
>>
8
;
right
=
(
level
&
0xff00
)
>>
8
;
if
(
left
!=
right
)
{
if
(
left
!=
right
)
{
F
orma
tWarning
(
oss_mixer_domain
,
F
m
tWarning
(
oss_mixer_domain
,
"volume for left and right is not the same,
\"
%i
\"
and "
"volume for left and right is not the same,
\"
{}
\"
and "
"
\"
%i
\"\n
"
,
left
,
right
);
"
\"
{}
\"\n
"
,
left
,
right
);
}
}
return
left
;
return
left
;
...
...
src/output/State.cxx
View file @
b29a43b4
...
@@ -70,8 +70,8 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
...
@@ -70,8 +70,8 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
name
=
endptr
+
1
;
name
=
endptr
+
1
;
auto
*
ao
=
outputs
.
FindByName
(
name
);
auto
*
ao
=
outputs
.
FindByName
(
name
);
if
(
ao
==
nullptr
)
{
if
(
ao
==
nullptr
)
{
F
orma
tDebug
(
output_domain
,
F
m
tDebug
(
output_domain
,
"Ignoring device state for '%s
'"
,
name
);
"Ignoring device state for '{}
'"
,
name
);
return
true
;
return
true
;
}
}
...
...
src/output/plugins/AoOutputPlugin.cxx
View file @
b29a43b4
...
@@ -123,7 +123,7 @@ AoOutput::AoOutput(const ConfigBlock &block)
...
@@ -123,7 +123,7 @@ AoOutput::AoOutput(const ConfigBlock &block)
if
(
ai
==
nullptr
)
if
(
ai
==
nullptr
)
throw
std
::
runtime_error
(
"problems getting driver info"
);
throw
std
::
runtime_error
(
"problems getting driver info"
);
F
ormatDebug
(
ao_output_domain
,
"using ao driver
\"
%s
\"
for
\"
%s
\"\n
"
,
F
mtDebug
(
ao_output_domain
,
"using ao driver
\"
{}
\"
for
\"
{}
\"\n
"
,
ai
->
short_name
,
block
.
GetBlockValue
(
"name"
,
nullptr
));
ai
->
short_name
,
block
.
GetBlockValue
(
"name"
,
nullptr
));
value
=
block
.
GetBlockValue
(
"options"
,
nullptr
);
value
=
block
.
GetBlockValue
(
"options"
,
nullptr
);
...
...
src/output/plugins/FifoOutputPlugin.cxx
View file @
b29a43b4
...
@@ -90,8 +90,8 @@ FifoOutput::FifoOutput(const ConfigBlock &block)
...
@@ -90,8 +90,8 @@ FifoOutput::FifoOutput(const ConfigBlock &block)
inline
void
inline
void
FifoOutput
::
Delete
()
FifoOutput
::
Delete
()
{
{
F
orma
tDebug
(
fifo_output_domain
,
F
m
tDebug
(
fifo_output_domain
,
"Removing FIFO
\"
%s
\"
"
,
path_utf8
.
c_str
()
);
"Removing FIFO
\"
{}
\"
"
,
path_utf8
);
try
{
try
{
RemoveFile
(
path
);
RemoveFile
(
path
);
...
...
src/output/plugins/HaikuOutputPlugin.cxx
View file @
b29a43b4
...
@@ -96,7 +96,7 @@ initialize_application()
...
@@ -96,7 +96,7 @@ initialize_application()
// TODO: actually Run() it and handle B_QUIT_REQUESTED
// TODO: actually Run() it and handle B_QUIT_REQUESTED
// TODO: use some locking?
// TODO: use some locking?
if
(
be_app
==
NULL
)
{
if
(
be_app
==
NULL
)
{
FormatDebug
(
haiku_output_domain
,
"creating be_app
\n
"
);
LogDebug
(
haiku_output_domain
,
"creating be_app
"
);
new
BApplication
(
"application/x-vnd.MusicPD"
);
new
BApplication
(
"application/x-vnd.MusicPD"
);
}
}
}
}
...
@@ -107,7 +107,7 @@ finalize_application()
...
@@ -107,7 +107,7 @@ finalize_application()
// TODO: use some locking?
// TODO: use some locking?
delete
be_app
;
delete
be_app
;
be_app
=
NULL
;
be_app
=
NULL
;
FormatDebug
(
haiku_output_domain
,
"deleting be_app
\n
"
);
LogDebug
(
haiku_output_domain
,
"deleting be_app
"
);
}
}
static
bool
static
bool
...
@@ -165,17 +165,16 @@ HaikuOutput::FillBuffer(void* _buffer, size_t size,
...
@@ -165,17 +165,16 @@ HaikuOutput::FillBuffer(void* _buffer, size_t size,
bigtime_t
w
=
system_time
()
-
start
;
bigtime_t
w
=
system_time
()
-
start
;
if
(
w
>
5000LL
)
{
if
(
w
>
5000LL
)
{
F
orma
tDebug
(
haiku_output_domain
,
F
m
tDebug
(
haiku_output_domain
,
"haiku:fill_buffer waited
%Ldus
\n
"
,
w
);
"haiku:fill_buffer waited
{}us
"
,
w
);
}
}
if
(
buffer_filled
<
buffer_size
)
{
if
(
buffer_filled
<
buffer_size
)
{
memset
(
buffer
+
buffer_filled
,
0
,
memset
(
buffer
+
buffer_filled
,
0
,
buffer_size
-
buffer_filled
);
buffer_size
-
buffer_filled
);
FormatDebug
(
haiku_output_domain
,
FmtDebug
(
haiku_output_domain
,
"haiku:fill_buffer filled %d size %d clearing remainder
\n
"
,
"haiku:fill_buffer filled {} size {} clearing remainder"
,
(
int
)
buffer_filled
,
(
int
)
buffer_size
);
buffer_filled
,
buffer_size
);
}
}
}
}
...
@@ -222,12 +221,12 @@ HaikuOutput::Open(AudioFormat &audio_format)
...
@@ -222,12 +221,12 @@ HaikuOutput::Open(AudioFormat &audio_format)
format
.
channel_count
,
format
.
format
,
format
.
channel_count
,
format
.
format
,
format
.
frame_rate
,
B_UNKNOWN_BUS
)
*
2
;
format
.
frame_rate
,
B_UNKNOWN_BUS
)
*
2
;
F
orma
tDebug
(
haiku_output_domain
,
F
m
tDebug
(
haiku_output_domain
,
"using haiku driver ad: bs: %d ws: %d
"
"using haiku driver ad: bs: {} ws: {}
"
"channels %d rate %f fmt %08lx bs %d
\n
"
,
"channels {} rate {} fmt {:08x} bs {}
"
,
(
int
)
buffer_size
,
(
int
)
write_size
,
buffer_size
,
write_size
,
(
int
)
format
.
channel_count
,
format
.
frame_rate
,
format
.
channel_count
,
format
.
frame_rate
,
format
.
format
,
(
int
)
format
.
buffer_size
);
format
.
format
,
format
.
buffer_size
);
sound_player
=
new
BSoundPlayer
(
&
format
,
"MPD Output"
,
sound_player
=
new
BSoundPlayer
(
&
format
,
"MPD Output"
,
HaikuOutput
::
_FillBuffer
,
NULL
,
this
);
HaikuOutput
::
_FillBuffer
,
NULL
,
this
);
...
@@ -247,8 +246,7 @@ HaikuOutput::Open(AudioFormat &audio_format)
...
@@ -247,8 +246,7 @@ HaikuOutput::Open(AudioFormat &audio_format)
buffer_delay
*=
1000
/
format
.
frame_rate
;
buffer_delay
*=
1000
/
format
.
frame_rate
;
// half of the total buffer play time
// half of the total buffer play time
buffer_delay
/=
2
;
buffer_delay
/=
2
;
FormatDebug
(
haiku_output_domain
,
FmtDebug
(
haiku_output_domain
,
"buffer delay: {} ms"
,
buffer_delay
);
"buffer delay: %d ms
\n
"
,
buffer_delay
);
new_buffer
=
create_sem
(
0
,
"New buffer request"
);
new_buffer
=
create_sem
(
0
,
"New buffer request"
);
buffer_done
=
create_sem
(
0
,
"Buffer done"
);
buffer_done
=
create_sem
(
0
,
"Buffer done"
);
...
@@ -303,8 +301,8 @@ HaikuOutput::Delay() const noexcept
...
@@ -303,8 +301,8 @@ HaikuOutput::Delay() const noexcept
{
{
unsigned
delay
=
buffer_filled
?
0
:
buffer_delay
;
unsigned
delay
=
buffer_filled
?
0
:
buffer_delay
;
//F
orma
tDebug(haiku_output_domain,
//F
m
tDebug(haiku_output_domain,
// "delay=
%d\n
", delay / 2);
// "delay=
{}
", delay / 2);
// XXX: doesn't work
// XXX: doesn't work
//return (delay / 2) ? 1 : 0;
//return (delay / 2) ? 1 : 0;
(
void
)
delay
;
(
void
)
delay
;
...
@@ -393,8 +391,9 @@ HaikuOutput::SendTag(const Tag &tag)
...
@@ -393,8 +391,9 @@ HaikuOutput::SendTag(const Tag &tag)
case
TAG_MUSICBRAINZ_ALBUMARTISTID
:
case
TAG_MUSICBRAINZ_ALBUMARTISTID
:
case
TAG_MUSICBRAINZ_TRACKID
:
case
TAG_MUSICBRAINZ_TRACKID
:
default
:
default
:
FormatDebug
(
haiku_output_domain
,
FmtDebug
(
haiku_output_domain
,
"tag item: type %d value '%s'
\n
"
,
item
.
type
,
item
.
value
);
"tag item: type {} value '{}'
\n
"
,
item
.
type
,
item
.
value
);
break
;
break
;
}
}
}
}
...
...
src/output/plugins/JackOutputPlugin.cxx
View file @
b29a43b4
...
@@ -242,8 +242,8 @@ JackOutput::JackOutput(const ConfigBlock &block)
...
@@ -242,8 +242,8 @@ JackOutput::JackOutput(const ConfigBlock &block)
/* compatibility with MPD < 0.16 */
/* compatibility with MPD < 0.16 */
value
=
block
.
GetBlockValue
(
"ports"
,
nullptr
);
value
=
block
.
GetBlockValue
(
"ports"
,
nullptr
);
if
(
value
!=
nullptr
)
if
(
value
!=
nullptr
)
F
orma
tWarning
(
jack_output_domain
,
F
m
tWarning
(
jack_output_domain
,
"deprecated option 'ports' in line %d
"
,
"deprecated option 'ports' in line {}
"
,
block
.
line
);
block
.
line
);
}
}
...
@@ -258,9 +258,9 @@ JackOutput::JackOutput(const ConfigBlock &block)
...
@@ -258,9 +258,9 @@ JackOutput::JackOutput(const ConfigBlock &block)
if
(
num_destination_ports
>
0
&&
if
(
num_destination_ports
>
0
&&
num_destination_ports
!=
num_source_ports
)
num_destination_ports
!=
num_source_ports
)
F
orma
tWarning
(
jack_output_domain
,
F
m
tWarning
(
jack_output_domain
,
"number of source ports (%u
) mismatches the "
"number of source ports ({}
) mismatches the "
"number of destination ports (%u) in line %d
"
,
"number of destination ports ({}) in line {}
"
,
num_source_ports
,
num_destination_ports
,
num_source_ports
,
num_destination_ports
,
block
.
line
);
block
.
line
);
...
@@ -543,10 +543,9 @@ JackOutput::Start()
...
@@ -543,10 +543,9 @@ JackOutput::Start()
for
(
num_dports
=
0
;
num_dports
<
MAX_PORTS
&&
for
(
num_dports
=
0
;
num_dports
<
MAX_PORTS
&&
jports
[
num_dports
]
!=
nullptr
;
jports
[
num_dports
]
!=
nullptr
;
++
num_dports
)
{
++
num_dports
)
{
FormatDebug
(
jack_output_domain
,
FmtDebug
(
jack_output_domain
,
"destination_port[%u] = '%s'
\n
"
,
"destination_port[{}] = '{}'
\n
"
,
num_dports
,
num_dports
,
jports
[
num_dports
]);
jports
[
num_dports
]);
dports
[
num_dports
]
=
jports
[
num_dports
];
dports
[
num_dports
]
=
jports
[
num_dports
];
}
}
}
else
{
}
else
{
...
...
src/output/plugins/OSXOutputPlugin.cxx
View file @
b29a43b4
...
@@ -258,9 +258,10 @@ osx_output_parse_channel_map(const char *device_name,
...
@@ -258,9 +258,10 @@ osx_output_parse_channel_map(const char *device_name,
channel_map_str
=
endptr
;
channel_map_str
=
endptr
;
want_number
=
false
;
want_number
=
false
;
FormatDebug
(
osx_output_domain
,
FmtDebug
(
osx_output_domain
,
"%s: channel_map[%u] = %d"
,
"{}: channel_map[{}] = {}"
,
device_name
,
inserted_channels
,
channel_map
[
inserted_channels
]);
device_name
,
inserted_channels
,
channel_map
[
inserted_channels
]);
++
inserted_channels
;
++
inserted_channels
;
continue
;
continue
;
}
}
...
@@ -421,10 +422,10 @@ osx_output_set_device_format(AudioDeviceID dev_id,
...
@@ -421,10 +422,10 @@ osx_output_set_device_format(AudioDeviceID dev_id,
// print all (linear pcm) formats and their rating
// print all (linear pcm) formats and their rating
if
(
score
>
0.0
f
)
if
(
score
>
0.0
f
)
F
orma
tDebug
(
osx_output_domain
,
F
m
tDebug
(
osx_output_domain
,
"Format: %s rated %f
"
,
"Format: {} rated {}
"
,
StreamDescriptionToString
(
format_desc
).
c_str
(),
StreamDescriptionToString
(
format_desc
).
c_str
(),
(
double
)
score
);
score
);
if
(
score
>
output_score
)
{
if
(
score
>
output_score
)
{
output_score
=
score
;
output_score
=
score
;
...
@@ -498,14 +499,14 @@ osx_output_hog_device(AudioDeviceID dev_id, bool hog) noexcept
...
@@ -498,14 +499,14 @@ osx_output_hog_device(AudioDeviceID dev_id, bool hog) noexcept
if
(
hog
)
{
if
(
hog
)
{
if
(
hog_pid
!=
-
1
)
{
if
(
hog_pid
!=
-
1
)
{
Format
Debug
(
osx_output_domain
,
Log
Debug
(
osx_output_domain
,
"Device is already hogged.
"
);
"Device is already hogged
"
);
return
;
return
;
}
}
}
else
{
}
else
{
if
(
hog_pid
!=
getpid
())
{
if
(
hog_pid
!=
getpid
())
{
F
orma
tDebug
(
osx_output_domain
,
F
m
tDebug
(
osx_output_domain
,
"Device is not owned by this process.
"
);
"Device is not owned by this process
"
);
return
;
return
;
}
}
}
}
...
@@ -520,9 +521,8 @@ osx_output_hog_device(AudioDeviceID dev_id, bool hog) noexcept
...
@@ -520,9 +521,8 @@ osx_output_hog_device(AudioDeviceID dev_id, bool hog) noexcept
size
,
size
,
&
hog_pid
);
&
hog_pid
);
if
(
err
!=
noErr
)
{
if
(
err
!=
noErr
)
{
FormatDebug
(
osx_output_domain
,
FmtDebug
(
osx_output_domain
,
"Cannot hog the device: %d"
,
"Cannot hog the device: {}"
,
err
);
err
);
}
else
{
}
else
{
LogDebug
(
osx_output_domain
,
LogDebug
(
osx_output_domain
,
hog_pid
==
-
1
hog_pid
==
-
1
...
@@ -585,16 +585,16 @@ osx_output_set_device(OSXOutput *oo)
...
@@ -585,16 +585,16 @@ osx_output_set_device(OSXOutput *oo)
const
auto
id
=
FindAudioDeviceByName
(
oo
->
device_name
);
const
auto
id
=
FindAudioDeviceByName
(
oo
->
device_name
);
F
orma
tDebug
(
osx_output_domain
,
F
m
tDebug
(
osx_output_domain
,
"found matching device: ID=%u, name=%s
"
,
"found matching device: ID={}, name={}
"
,
(
unsigned
)
id
,
oo
->
device_name
);
id
,
oo
->
device_name
);
AudioUnitSetCurrentDevice
(
oo
->
au
,
id
);
AudioUnitSetCurrentDevice
(
oo
->
au
,
id
);
oo
->
dev_id
=
id
;
oo
->
dev_id
=
id
;
F
orma
tDebug
(
osx_output_domain
,
F
m
tDebug
(
osx_output_domain
,
"set OS X audio output device ID=%u, name=%s
"
,
"set OS X audio output device ID={}, name={}
"
,
(
unsigned
)
id
,
oo
->
device_name
);
id
,
oo
->
device_name
);
if
(
oo
->
channel_map
)
if
(
oo
->
channel_map
)
osx_output_set_channel_map
(
oo
);
osx_output_set_channel_map
(
oo
);
...
...
src/output/plugins/OssOutputPlugin.cxx
View file @
b29a43b4
...
@@ -200,16 +200,16 @@ oss_open_default()
...
@@ -200,16 +200,16 @@ oss_open_default()
/* never reached */
/* never reached */
break
;
break
;
case
OSS_STAT_DOESN_T_EXIST
:
case
OSS_STAT_DOESN_T_EXIST
:
F
orma
tWarning
(
oss_output_domain
,
F
m
tWarning
(
oss_output_domain
,
"%s
not found"
,
dev
);
"{}
not found"
,
dev
);
break
;
break
;
case
OSS_STAT_NOT_CHAR_DEV
:
case
OSS_STAT_NOT_CHAR_DEV
:
F
orma
tWarning
(
oss_output_domain
,
F
m
tWarning
(
oss_output_domain
,
"%s
is not a character device"
,
dev
);
"{}
is not a character device"
,
dev
);
break
;
break
;
case
OSS_STAT_NO_PERMS
:
case
OSS_STAT_NO_PERMS
:
F
orma
tWarning
(
oss_output_domain
,
F
m
tWarning
(
oss_output_domain
,
"%s
: permission denied"
,
dev
);
"{}
: permission denied"
,
dev
);
break
;
break
;
case
OSS_STAT_OTHER
:
case
OSS_STAT_OTHER
:
FormatErrno
(
oss_output_domain
,
err
[
i
],
FormatErrno
(
oss_output_domain
,
err
[
i
],
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
b29a43b4
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "RecorderOutputPlugin.hxx"
#include "RecorderOutputPlugin.hxx"
#include "../OutputAPI.hxx"
#include "../OutputAPI.hxx"
#include "lib/fmt/PathFormatter.hxx"
#include "tag/Format.hxx"
#include "tag/Format.hxx"
#include "encoder/ToOutputStream.hxx"
#include "encoder/ToOutputStream.hxx"
#include "encoder/EncoderInterface.hxx"
#include "encoder/EncoderInterface.hxx"
...
@@ -276,8 +277,7 @@ RecorderOutput::ReopenFormat(AllocatedPath &&new_path)
...
@@ -276,8 +277,7 @@ RecorderOutput::ReopenFormat(AllocatedPath &&new_path)
path
=
std
::
move
(
new_path
);
path
=
std
::
move
(
new_path
);
file
=
new_file
;
file
=
new_file
;
FormatDebug
(
recorder_domain
,
"Recording to
\"
%s
\"
"
,
FmtDebug
(
recorder_domain
,
"Recording to
\"
{}
\"
"
,
path
);
path
.
ToUTF8
().
c_str
());
}
}
void
void
...
...
src/output/plugins/ShoutOutputPlugin.cxx
View file @
b29a43b4
...
@@ -282,8 +282,8 @@ ShoutOutput::Close() noexcept
...
@@ -282,8 +282,8 @@ ShoutOutput::Close() noexcept
if
(
shout_get_connected
(
shout_conn
)
!=
SHOUTERR_UNCONNECTED
&&
if
(
shout_get_connected
(
shout_conn
)
!=
SHOUTERR_UNCONNECTED
&&
shout_close
(
shout_conn
)
!=
SHOUTERR_SUCCESS
)
{
shout_close
(
shout_conn
)
!=
SHOUTERR_SUCCESS
)
{
F
orma
tWarning
(
shout_output_domain
,
F
m
tWarning
(
shout_output_domain
,
"problem closing connection to shout server: %s
"
,
"problem closing connection to shout server: {}
"
,
shout_get_error
(
shout_conn
));
shout_get_error
(
shout_conn
));
}
}
}
}
...
...
src/output/plugins/httpd/HttpdClient.cxx
View file @
b29a43b4
...
@@ -171,8 +171,8 @@ HttpdClient::SendResponse() noexcept
...
@@ -171,8 +171,8 @@ HttpdClient::SendResponse() noexcept
ssize_t
nbytes
=
GetSocket
().
Write
(
response
,
strlen
(
response
));
ssize_t
nbytes
=
GetSocket
().
Write
(
response
,
strlen
(
response
));
if
(
gcc_unlikely
(
nbytes
<
0
))
{
if
(
gcc_unlikely
(
nbytes
<
0
))
{
const
SocketErrorMessage
msg
;
const
SocketErrorMessage
msg
;
F
orma
tWarning
(
httpd_output_domain
,
F
m
tWarning
(
httpd_output_domain
,
"failed to write to client: %s
"
,
"failed to write to client: {}
"
,
(
const
char
*
)
msg
);
(
const
char
*
)
msg
);
LockClose
();
LockClose
();
return
false
;
return
false
;
...
@@ -284,8 +284,8 @@ HttpdClient::TryWrite() noexcept
...
@@ -284,8 +284,8 @@ HttpdClient::TryWrite() noexcept
if
(
!
IsSocketErrorClosed
(
e
))
{
if
(
!
IsSocketErrorClosed
(
e
))
{
SocketErrorMessage
msg
(
e
);
SocketErrorMessage
msg
(
e
);
F
orma
tWarning
(
httpd_output_domain
,
F
m
tWarning
(
httpd_output_domain
,
"failed to write to client: %s
"
,
"failed to write to client: {}
"
,
(
const
char
*
)
msg
);
(
const
char
*
)
msg
);
}
}
...
@@ -311,8 +311,8 @@ HttpdClient::TryWrite() noexcept
...
@@ -311,8 +311,8 @@ HttpdClient::TryWrite() noexcept
if
(
!
IsSocketErrorClosed
(
e
))
{
if
(
!
IsSocketErrorClosed
(
e
))
{
SocketErrorMessage
msg
(
e
);
SocketErrorMessage
msg
(
e
);
F
orma
tWarning
(
httpd_output_domain
,
F
m
tWarning
(
httpd_output_domain
,
"failed to write to client: %s
"
,
"failed to write to client: {}
"
,
(
const
char
*
)
msg
);
(
const
char
*
)
msg
);
}
}
...
@@ -334,8 +334,8 @@ HttpdClient::TryWrite() noexcept
...
@@ -334,8 +334,8 @@ HttpdClient::TryWrite() noexcept
if
(
!
IsSocketErrorClosed
(
e
))
{
if
(
!
IsSocketErrorClosed
(
e
))
{
SocketErrorMessage
msg
(
e
);
SocketErrorMessage
msg
(
e
);
F
orma
tWarning
(
httpd_output_domain
,
F
m
tWarning
(
httpd_output_domain
,
"failed to write to client: %s
"
,
"failed to write to client: {}
"
,
(
const
char
*
)
msg
);
(
const
char
*
)
msg
);
}
}
...
@@ -370,7 +370,7 @@ HttpdClient::PushPage(PagePtr page) noexcept
...
@@ -370,7 +370,7 @@ HttpdClient::PushPage(PagePtr page) noexcept
return
;
return
;
if
(
queue_size
>
256
*
1024
)
{
if
(
queue_size
>
256
*
1024
)
{
Format
Debug
(
httpd_output_domain
,
Log
Debug
(
httpd_output_domain
,
"client is too slow, flushing its queue"
);
"client is too slow, flushing its queue"
);
ClearQueue
();
ClearQueue
();
}
}
...
...
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
View file @
b29a43b4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "PropertyStore.hxx"
#include "PropertyStore.hxx"
#include "output/OutputAPI.hxx"
#include "output/OutputAPI.hxx"
#include "lib/icu/Win32.hxx"
#include "lib/icu/Win32.hxx"
#include "lib/fmt/AudioFormatFormatter.hxx"
#include "mixer/MixerList.hxx"
#include "mixer/MixerList.hxx"
#include "output/Error.hxx"
#include "output/Error.hxx"
#include "pcm/Export.hxx"
#include "pcm/Export.hxx"
...
@@ -824,13 +825,12 @@ WasapiOutput::TryFormatExclusive(const AudioFormat &audio_format)
...
@@ -824,13 +825,12 @@ WasapiOutput::TryFormatExclusive(const AudioFormat &audio_format)
HRESULT
result
=
client
->
IsFormatSupported
(
HRESULT
result
=
client
->
IsFormatSupported
(
AUDCLNT_SHAREMODE_EXCLUSIVE
,
AUDCLNT_SHAREMODE_EXCLUSIVE
,
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
test_format
),
nullptr
);
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
test_format
),
nullptr
);
const
auto
format_string
=
ToString
(
audio_format
);
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
F
ormatDebug
(
wasapi_output_domain
,
"Trying %s %lu %u-%u (exclusive) -> %s
"
,
F
mtDebug
(
wasapi_output_domain
,
"Trying {} {} {}-{} (exclusive) -> {}
"
,
format_string
.
c_str
()
,
test_format
.
Format
.
nSamplesPerSec
,
audio_format
,
test_format
.
Format
.
nSamplesPerSec
,
test_format
.
Format
.
wBitsPerSample
,
test_format
.
Format
.
wBitsPerSample
,
test_format
.
Samples
.
wValidBitsPerSample
,
test_format
.
Samples
.
wValidBitsPerSample
,
result_string
.
c_str
()
);
result_string
);
if
(
SUCCEEDED
(
result
))
{
if
(
SUCCEEDED
(
result
))
{
device_format
=
test_format
;
device_format
=
test_format
;
return
true
;
return
true
;
...
@@ -922,13 +922,12 @@ WasapiOutput::FindSharedFormatSupported(AudioFormat &audio_format)
...
@@ -922,13 +922,12 @@ WasapiOutput::FindSharedFormatSupported(AudioFormat &audio_format)
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
device_format
),
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
device_format
),
closest_format
.
AddressCast
<
WAVEFORMATEX
>
());
closest_format
.
AddressCast
<
WAVEFORMATEX
>
());
{
{
const
auto
format_string
=
ToString
(
audio_format
);
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
F
ormatDebug
(
wasapi_output_domain
,
"Trying %s %lu %u-%u (shared) -> %s
"
,
F
mtDebug
(
wasapi_output_domain
,
"Trying {} {} {}-{} (shared) -> {}
"
,
format_string
.
c_str
()
,
device_format
.
Format
.
nSamplesPerSec
,
audio_format
,
device_format
.
Format
.
nSamplesPerSec
,
device_format
.
Format
.
wBitsPerSample
,
device_format
.
Format
.
wBitsPerSample
,
device_format
.
Samples
.
wValidBitsPerSample
,
device_format
.
Samples
.
wValidBitsPerSample
,
result_string
.
c_str
()
);
result_string
);
}
}
if
(
FAILED
(
result
)
&&
result
!=
AUDCLNT_E_UNSUPPORTED_FORMAT
)
{
if
(
FAILED
(
result
)
&&
result
!=
AUDCLNT_E_UNSUPPORTED_FORMAT
)
{
...
@@ -950,15 +949,14 @@ WasapiOutput::FindSharedFormatSupported(AudioFormat &audio_format)
...
@@ -950,15 +949,14 @@ WasapiOutput::FindSharedFormatSupported(AudioFormat &audio_format)
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
device_format
),
reinterpret_cast
<
WAVEFORMATEX
*>
(
&
device_format
),
closest_format
.
AddressCast
<
WAVEFORMATEX
>
());
closest_format
.
AddressCast
<
WAVEFORMATEX
>
());
{
{
const
auto
format_string
=
ToString
(
audio_format
);
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
const
auto
result_string
=
std
::
string
(
HRESULTToString
(
result
));
F
orma
tDebug
(
wasapi_output_domain
,
F
m
tDebug
(
wasapi_output_domain
,
"Trying %s %lu %u-%u (shared) -> %s
"
,
"Trying {} {} {}-{} (shared) -> {}
"
,
format_string
.
c_str
()
,
audio_format
,
device_format
.
Format
.
nSamplesPerSec
,
device_format
.
Format
.
nSamplesPerSec
,
device_format
.
Format
.
wBitsPerSample
,
device_format
.
Format
.
wBitsPerSample
,
device_format
.
Samples
.
wValidBitsPerSample
,
device_format
.
Samples
.
wValidBitsPerSample
,
result_string
.
c_str
()
);
result_string
);
}
}
if
(
FAILED
(
result
))
{
if
(
FAILED
(
result
))
{
throw
MakeHResultError
(
result
,
"Format is not supported"
);
throw
MakeHResultError
(
result
,
"Format is not supported"
);
...
...
src/pcm/LibsamplerateResampler.cxx
View file @
b29a43b4
...
@@ -71,8 +71,8 @@ pcm_resample_lsr_global_init(const ConfigBlock &block)
...
@@ -71,8 +71,8 @@ pcm_resample_lsr_global_init(const ConfigBlock &block)
throw
FormatRuntimeError
(
"unknown samplerate converter '%s'"
,
throw
FormatRuntimeError
(
"unknown samplerate converter '%s'"
,
converter
);
converter
);
F
orma
tDebug
(
libsamplerate_domain
,
F
m
tDebug
(
libsamplerate_domain
,
"libsamplerate converter '%s
'"
,
"libsamplerate converter '{}
'"
,
src_get_name
(
lsr_converter
));
src_get_name
(
lsr_converter
));
}
}
...
@@ -98,8 +98,8 @@ LibsampleratePcmResampler::Open(AudioFormat &af, unsigned new_sample_rate)
...
@@ -98,8 +98,8 @@ LibsampleratePcmResampler::Open(AudioFormat &af, unsigned new_sample_rate)
memset
(
&
data
,
0
,
sizeof
(
data
));
memset
(
&
data
,
0
,
sizeof
(
data
));
data
.
src_ratio
=
double
(
new_sample_rate
)
/
double
(
af
.
sample_rate
);
data
.
src_ratio
=
double
(
new_sample_rate
)
/
double
(
af
.
sample_rate
);
F
orma
tDebug
(
libsamplerate_domain
,
F
m
tDebug
(
libsamplerate_domain
,
"setting samplerate conversion ratio to %.2lf
"
,
"setting samplerate conversion ratio to {:.2}
"
,
data
.
src_ratio
);
data
.
src_ratio
);
src_set_ratio
(
state
,
data
.
src_ratio
);
src_set_ratio
(
state
,
data
.
src_ratio
);
...
...
src/pcm/SoxrResampler.cxx
View file @
b29a43b4
...
@@ -200,8 +200,7 @@ pcm_resample_soxr_global_init(const ConfigBlock &block)
...
@@ -200,8 +200,7 @@ pcm_resample_soxr_global_init(const ConfigBlock &block)
soxr_quality
=
soxr_quality_spec
(
recipe
,
0
);
soxr_quality
=
soxr_quality_spec
(
recipe
,
0
);
}
}
FormatDebug
(
soxr_domain
,
FmtDebug
(
soxr_domain
,
"soxr converter '{}'"
,
"soxr converter '%s'"
,
soxr_quality_name
(
recipe
));
soxr_quality_name
(
recipe
));
const
unsigned
n_threads
=
block
.
GetBlockValue
(
"threads"
,
1
);
const
unsigned
n_threads
=
block
.
GetBlockValue
(
"threads"
,
1
);
...
@@ -226,7 +225,7 @@ SoxrPcmResampler::Open(AudioFormat &af, unsigned new_sample_rate)
...
@@ -226,7 +225,7 @@ SoxrPcmResampler::Open(AudioFormat &af, unsigned new_sample_rate)
throw
FormatRuntimeError
(
"soxr initialization has failed: %s"
,
throw
FormatRuntimeError
(
"soxr initialization has failed: %s"
,
e
);
e
);
F
ormatDebug
(
soxr_domain
,
"soxr engine '%s
'"
,
soxr_engine
(
soxr
));
F
mtDebug
(
soxr_domain
,
"soxr engine '{}
'"
,
soxr_engine
(
soxr
));
if
(
soxr_use_custom_recipe
)
if
(
soxr_use_custom_recipe
)
FormatDebug
(
soxr_domain
,
FormatDebug
(
soxr_domain
,
"soxr precision=%0.0f, phase_response=%0.2f, "
"soxr precision=%0.0f, phase_response=%0.2f, "
...
...
src/pcm/meson.build
View file @
b29a43b4
...
@@ -69,6 +69,7 @@ pcm = static_library(
...
@@ -69,6 +69,7 @@ pcm = static_library(
pcm_basic_dep,
pcm_basic_dep,
libsamplerate_dep,
libsamplerate_dep,
soxr_dep,
soxr_dep,
log_dep,
],
],
)
)
...
...
src/player/CrossFade.cxx
View file @
b29a43b4
...
@@ -128,8 +128,8 @@ CrossFadeSettings::Calculate(SignedSongTime total_time,
...
@@ -128,8 +128,8 @@ CrossFadeSettings::Calculate(SignedSongTime total_time,
mixramp_delay
<=
mixramp_overlap
)
{
mixramp_delay
<=
mixramp_overlap
)
{
chunks
=
lround
((
mixramp_overlap
-
mixramp_delay
)
chunks
=
lround
((
mixramp_overlap
-
mixramp_delay
)
/
chunk_duration
);
/
chunk_duration
);
F
orma
tDebug
(
cross_fade_domain
,
F
m
tDebug
(
cross_fade_domain
,
"will overlap %d chunks, %f
s"
,
chunks
,
"will overlap {} chunks, {}
s"
,
chunks
,
(
mixramp_overlap
-
mixramp_delay
).
count
());
(
mixramp_overlap
-
mixramp_delay
).
count
());
}
}
}
}
...
...
src/queue/Playlist.cxx
View file @
b29a43b4
...
@@ -71,7 +71,7 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order) noexcept
...
@@ -71,7 +71,7 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order) noexcept
const
DetachedSong
&
song
=
queue
.
GetOrder
(
order
);
const
DetachedSong
&
song
=
queue
.
GetOrder
(
order
);
F
ormatDebug
(
playlist_domain
,
"queue song %i:
\"
%s
\"
"
,
F
mtDebug
(
playlist_domain
,
"queue song {}:
\"
{}
\"
"
,
queued
,
song
.
GetURI
());
queued
,
song
.
GetURI
());
pc
.
LockEnqueueSong
(
std
::
make_unique
<
DetachedSong
>
(
song
));
pc
.
LockEnqueueSong
(
std
::
make_unique
<
DetachedSong
>
(
song
));
...
@@ -178,7 +178,7 @@ playlist::PlayOrder(PlayerControl &pc, unsigned order)
...
@@ -178,7 +178,7 @@ playlist::PlayOrder(PlayerControl &pc, unsigned order)
const
DetachedSong
&
song
=
queue
.
GetOrder
(
order
);
const
DetachedSong
&
song
=
queue
.
GetOrder
(
order
);
F
ormatDebug
(
playlist_domain
,
"play %u:
\"
%s
\"
"
,
order
,
song
.
GetURI
());
F
mtDebug
(
playlist_domain
,
"play {}:
\"
{}
\"
"
,
order
,
song
.
GetURI
());
current
=
order
;
current
=
order
;
...
...
src/queue/PlaylistControl.cxx
View file @
b29a43b4
...
@@ -36,7 +36,7 @@ playlist::Stop(PlayerControl &pc) noexcept
...
@@ -36,7 +36,7 @@ playlist::Stop(PlayerControl &pc) noexcept
assert
(
current
>=
0
);
assert
(
current
>=
0
);
Format
Debug
(
playlist_domain
,
"stop"
);
Log
Debug
(
playlist_domain
,
"stop"
);
pc
.
LockStop
();
pc
.
LockStop
();
queued
=
-
1
;
queued
=
-
1
;
playing
=
false
;
playing
=
false
;
...
...
src/zeroconf/Bonjour.cxx
View file @
b29a43b4
...
@@ -79,8 +79,8 @@ BonjourHelper::Callback([[maybe_unused]] DNSServiceRef sdRef,
...
@@ -79,8 +79,8 @@ BonjourHelper::Callback([[maybe_unused]] DNSServiceRef sdRef,
helper
.
Cancel
();
helper
.
Cancel
();
}
else
{
}
else
{
F
orma
tDebug
(
bonjour_domain
,
F
m
tDebug
(
bonjour_domain
,
"Registered zeroconf service with name '%s
'"
,
"Registered zeroconf service with name '{}
'"
,
name
);
name
);
}
}
}
}
...
...
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