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
810446ac
Commit
810446ac
authored
Apr 14, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: fix compilation and simplify overly complicated code by adapting to the hotplug API
parent
8a840ec4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
37 deletions
+6
-37
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+6
-37
No files found.
modules/audio_output/auhal.c
View file @
810446ac
...
...
@@ -133,7 +133,6 @@ static int StartAnalog (audio_output_t *, audio_sample_format_t
static
int
StartSPDIF
(
audio_output_t
*
,
audio_sample_format_t
*
);
static
void
Stop
(
audio_output_t
*
);
static
int
DeviceList
(
audio_output_t
*
p_aout
,
char
***
namesp
,
char
***
descsp
);
static
void
RebuildDeviceList
(
audio_output_t
*
);
static
int
SwitchAudioDevice
(
audio_output_t
*
p_aout
,
const
char
*
name
);
static
int
VolumeSet
(
audio_output_t
*
,
float
);
...
...
@@ -193,7 +192,6 @@ static int Open(vlc_object_t *obj)
p_aout
->
stop
=
Stop
;
p_aout
->
volume_set
=
VolumeSet
;
p_aout
->
mute_set
=
MuteSet
;
p_aout
->
device_enum
=
DeviceList
;
p_aout
->
sys
->
devices
=
NULL
;
p_aout
->
device_select
=
SwitchAudioDevice
;
...
...
@@ -967,41 +965,12 @@ static void Stop(audio_output_t *p_aout)
#pragma mark -
#pragma mark core interaction
static
int
DeviceList
(
audio_output_t
*
p_aout
,
char
***
namesp
,
char
***
descsp
)
static
void
ReportDevice
(
audio_output_t
*
p_aout
,
UInt32
i_id
,
char
*
name
)
{
struct
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
char
**
names
,
**
descs
;
unsigned
n
=
0
;
for
(
struct
audio_device_t
*
device
=
p_sys
->
devices
;
device
!=
NULL
;
device
=
device
->
next
)
n
++
;
*
namesp
=
names
=
xmalloc
(
sizeof
(
*
names
)
*
n
);
*
descsp
=
descs
=
xmalloc
(
sizeof
(
*
descs
)
*
n
);
char
deviceid
[
100
];
for
(
struct
audio_device_t
*
device
=
p_sys
->
devices
;
device
!=
NULL
;
device
=
device
->
next
)
{
sprintf
(
deviceid
,
"%i"
,
device
->
deviceid
);
*
(
names
++
)
=
strdup
(
deviceid
);
*
(
descs
++
)
=
strdup
(
device
->
name
);
}
return
n
;
}
static
void
add_device_to_list
(
audio_output_t
*
p_aout
,
UInt32
i_id
,
char
*
name
)
{
struct
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
struct
audio_device_t
*
device
=
malloc
(
sizeof
(
*
device
));
if
(
unlikely
(
device
==
NULL
))
return
;
device
->
next
=
p_sys
->
devices
;
device
->
deviceid
=
i_id
;
device
->
name
=
strdup
(
name
);
sprintf
(
deviceid
,
"%i"
,
i_id
);
p_sys
->
devices
=
device
;
aout_HotplugReport
(
p_aout
,
deviceid
,
name
)
;
}
static
void
RebuildDeviceList
(
audio_output_t
*
p_aout
)
...
...
@@ -1096,7 +1065,7 @@ static void RebuildDeviceList(audio_output_t * p_aout)
continue
;
}
add_device_to_list
(
p_aout
,
i_id
,
psz_name
);
ReportDevice
(
p_aout
,
i_id
,
psz_name
);
if
(
AudioDeviceSupportsDigital
(
p_aout
,
deviceIDs
[
i
]))
{
b_digital
=
true
;
...
...
@@ -1104,7 +1073,7 @@ static void RebuildDeviceList(audio_output_t * p_aout)
char
*
psz_encoded_name
=
nil
;
asprintf
(
&
psz_encoded_name
,
_
(
"%s (Encoded Output)"
),
psz_name
);
i_id
=
i_id
|
AOUT_VAR_SPDIF_FLAG
;
add_device_to_list
(
p_aout
,
i_id
,
psz_encoded_name
);
ReportDevice
(
p_aout
,
i_id
,
psz_encoded_name
);
free
(
psz_encoded_name
);
}
...
...
@@ -1116,7 +1085,7 @@ static void RebuildDeviceList(audio_output_t * p_aout)
}
// TODO: fix default audio device
add_device_to_list
(
p_aout
,
0
,
_
(
"System Sound Output Device"
));
ReportDevice
(
p_aout
,
0
,
_
(
"System Sound Output Device"
));
free
(
deviceIDs
);
}
...
...
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