Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
88d90003
Commit
88d90003
authored
Apr 14, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevice: adapt to hotplug event
(However support for IMMNotificationClient remains missing.)
parent
da917bba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
modules/audio_output/mmdevice.c
modules/audio_output/mmdevice.c
+8
-15
No files found.
modules/audio_output/mmdevice.c
View file @
88d90003
...
...
@@ -473,7 +473,7 @@ static void *MMThread(void *data)
}
/*** Audio devices ***/
static
int
DevicesEnum
(
audio_output_t
*
aout
,
char
***
idp
,
char
***
namep
)
static
int
DevicesEnum
(
audio_output_t
*
aout
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
HRESULT
hr
;
...
...
@@ -494,16 +494,13 @@ static int DevicesEnum(audio_output_t *aout, char ***idp, char ***namep)
msg_Warn
(
aout
,
"cannot count audio endpoints (error 0x%lx)"
,
hr
);
count
=
0
;
}
else
msg_Dbg
(
aout
,
"Available Windows Audio devices:"
);
char
**
ids
=
xmalloc
(
count
*
sizeof
(
*
ids
));
char
**
names
=
xmalloc
(
count
*
sizeof
(
*
names
));
unsigned
n
=
0
;
for
(
UINT
i
=
0
;
i
<
count
;
i
++
)
{
IMMDevice
*
dev
;
char
*
id
,
*
name
=
NULL
;
hr
=
IMMDeviceCollection_Item
(
devs
,
i
,
&
dev
);
if
(
FAILED
(
hr
))
...
...
@@ -517,8 +514,7 @@ static int DevicesEnum(audio_output_t *aout, char ***idp, char ***namep)
IMMDevice_Release
(
dev
);
continue
;
}
ids
[
n
]
=
FromWide
(
devid
);
names
[
n
]
=
NULL
;
id
=
FromWide
(
devid
);
CoTaskMemFree
(
devid
);
/* User-readable device name */
...
...
@@ -531,21 +527,18 @@ static int DevicesEnum(audio_output_t *aout, char ***idp, char ***namep)
PropVariantInit
(
&
v
);
hr
=
IPropertyStore_GetValue
(
props
,
&
PKEY_Device_FriendlyName
,
&
v
);
if
(
SUCCEEDED
(
hr
))
name
s
[
n
]
=
FromWide
(
v
.
pwszVal
);
name
=
FromWide
(
v
.
pwszVal
);
PropVariantClear
(
&
v
);
IPropertyStore_Release
(
props
);
}
IMMDevice_Release
(
dev
);
if
(
names
[
n
]
==
NULL
)
names
[
n
]
=
xstrdup
(
ids
[
n
]);
msg_Dbg
(
aout
,
"%s (%s)"
,
ids
[
n
],
names
[
n
]);
aout_HotplugReport
(
aout
,
id
,
(
name
!=
NULL
)
?
name
:
id
);
free
(
name
);
free
(
id
);
n
++
;
}
IMMDeviceCollection_Release
(
devs
);
*
idp
=
ids
;
*
namep
=
names
;
return
n
;
}
...
...
@@ -765,8 +758,8 @@ static int Open(vlc_object_t *obj)
aout
->
flush
=
Flush
;
aout
->
volume_set
=
VolumeSet
;
aout
->
mute_set
=
MuteSet
;
aout
->
device_enum
=
DevicesEnum
;
aout
->
device_select
=
DeviceSelect
;
DevicesEnum
(
aout
);
return
VLC_SUCCESS
;
error:
...
...
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