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
fc20a1f1
Commit
fc20a1f1
authored
Mar 05, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/wasapi: EnumerateDevices() logs, no std::vector
parent
a4257e51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
16 deletions
+7
-16
WasapiOutputPlugin.cxx
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+7
-16
No files found.
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
View file @
fc20a1f1
...
...
@@ -239,7 +239,6 @@ private:
bool
is_exclusive
;
bool
enumerate_devices
;
std
::
string
device_config
;
std
::
vector
<
std
::
pair
<
unsigned
int
,
AllocatedString
>>
device_desc
;
ComPtr
<
IMMDeviceEnumerator
>
enumerator
;
ComPtr
<
IMMDevice
>
device
;
ComPtr
<
IAudioClient
>
client
;
...
...
@@ -604,12 +603,11 @@ void WasapiOutput::OpenDevice() {
enumerator
.
CoCreateInstance
(
__uuidof
(
MMDeviceEnumerator
),
nullptr
,
CLSCTX_INPROC_SERVER
);
if
(
enumerate_devices
&&
SafeTry
([
this
]()
{
EnumerateDevices
();
}))
{
for
(
const
auto
&
[
device
,
desc
]
:
device_desc
)
{
FormatNotice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
device
,
desc
.
c_str
());
if
(
enumerate_devices
)
{
try
{
EnumerateDevices
();
}
catch
(...)
{
LogError
(
std
::
current_exception
());
}
}
...
...
@@ -625,8 +623,6 @@ void WasapiOutput::OpenDevice() {
}
else
{
device
=
GetDefaultAudioEndpoint
(
*
enumerator
);
}
device_desc
.
clear
();
}
/// run inside COMWorkerThread
...
...
@@ -800,15 +796,9 @@ void WasapiOutput::FindSharedFormatSupported(AudioFormat &audio_format) {
/// run inside COMWorkerThread
void
WasapiOutput
::
EnumerateDevices
()
{
if
(
!
device_desc
.
empty
())
{
return
;
}
const
auto
device_collection
=
EnumAudioEndpoints
(
*
enumerator
);
const
UINT
count
=
GetCount
(
*
device_collection
);
device_desc
.
reserve
(
count
);
for
(
UINT
i
=
0
;
i
<
count
;
++
i
)
{
const
auto
enumerated_device
=
Item
(
*
device_collection
,
i
);
...
...
@@ -820,7 +810,8 @@ void WasapiOutput::EnumerateDevices() {
if
(
name
==
nullptr
)
continue
;
device_desc
.
emplace_back
(
i
,
std
::
move
(
name
));
FormatNotice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
i
,
name
.
c_str
());
}
}
...
...
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