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
d5861971
Commit
d5861971
authored
May 13, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: synchronize access to devices_list
parent
de2b5038
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+10
-1
No files found.
modules/audio_output/auhal.c
View file @
d5861971
...
...
@@ -111,6 +111,7 @@ struct aout_sys_t
int
i_bytes_per_sample
;
CFArrayRef
device_list
;
vlc_mutex_t
device_list_lock
;
float
f_volume
;
bool
b_mute
;
...
...
@@ -180,6 +181,7 @@ static int Open(vlc_object_t *obj)
OSStatus
err
=
noErr
;
vlc_mutex_init
(
&
p_sys
->
device_list_lock
);
vlc_mutex_init
(
&
p_sys
->
lock
);
vlc_cond_init
(
&
p_sys
->
cond
);
p_sys
->
b_digital
=
false
;
...
...
@@ -226,6 +228,7 @@ static void Close(vlc_object_t *obj)
if
(
err
!=
noErr
)
msg_Err
(
p_aout
,
"AudioHardwareRemovePropertyListener failed [%4.4s]"
,
(
char
*
)
&
err
);
vlc_mutex_lock
(
&
p_sys
->
device_list_lock
);
/* remove streams callbacks */
CFIndex
count
=
CFArrayGetCount
(
p_sys
->
device_list
);
if
(
count
>
0
)
{
...
...
@@ -242,10 +245,13 @@ static void Close(vlc_object_t *obj)
}
}
CFRelease
(
p_sys
->
device_list
);
vlc_mutex_unlock
(
&
p_sys
->
device_list_lock
);
config_PutPsz
(
p_aout
,
"auhal-audio-device"
,
aout_DeviceGet
(
p_aout
));
CFRelease
(
p_sys
->
device_list
);
vlc_mutex_destroy
(
&
p_sys
->
device_list_lock
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
vlc_cond_destroy
(
&
p_sys
->
cond
);
...
...
@@ -1186,6 +1192,7 @@ static void RebuildDeviceList(audio_output_t * p_aout)
free
(
psz_name
);
}
vlc_mutex_lock
(
&
p_sys
->
device_list_lock
);
CFIndex
count
=
0
;
if
(
p_sys
->
device_list
)
count
=
CFArrayGetCount
(
p_sys
->
device_list
);
...
...
@@ -1211,6 +1218,8 @@ static void RebuildDeviceList(audio_output_t * p_aout)
if
(
!
CFArrayContainsValue
(
p_sys
->
device_list
,
CFRangeMake
(
0
,
CFArrayGetCount
(
p_sys
->
device_list
)),
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
p_sys
->
i_selected_dev
)))
aout_RestartRequest
(
p_aout
,
AOUT_RESTART_OUTPUT
);
vlc_mutex_unlock
(
&
p_sys
->
device_list_lock
);
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