Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
2d3723d1
Commit
2d3723d1
authored
Nov 12, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directsound: fix uninitialized mutex and condition variable
Regression from
3044105e
.
parent
36802a2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
modules/audio_output/directsound.c
modules/audio_output/directsound.c
+11
-6
No files found.
modules/audio_output/directsound.c
View file @
2d3723d1
...
@@ -548,9 +548,12 @@ static HRESULT Stop( aout_stream_sys_t *p_sys )
...
@@ -548,9 +548,12 @@ static HRESULT Stop( aout_stream_sys_t *p_sys )
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
b_playing
=
true
;
p_sys
->
b_playing
=
true
;
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_cond_signal
(
&
p_sys
->
cond
);
vlc_cancel
(
p_sys
->
eraser_thread
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_cancel
(
p_sys
->
eraser_thread
);
vlc_join
(
p_sys
->
eraser_thread
,
NULL
);
vlc_join
(
p_sys
->
eraser_thread
,
NULL
);
vlc_cond_destroy
(
&
p_sys
->
cond
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
if
(
p_sys
->
p_notify
!=
NULL
)
if
(
p_sys
->
p_notify
!=
NULL
)
{
{
IDirectSoundNotify_Release
(
p_sys
->
p_notify
);
IDirectSoundNotify_Release
(
p_sys
->
p_notify
);
...
@@ -767,12 +770,19 @@ static HRESULT Start( vlc_object_t *obj, aout_stream_sys_t *sys,
...
@@ -767,12 +770,19 @@ static HRESULT Start( vlc_object_t *obj, aout_stream_sys_t *sys,
}
}
}
}
vlc_mutex_init
(
&
sys
->
lock
);
vlc_cond_init
(
&
sys
->
cond
);
int
ret
=
vlc_clone
(
&
sys
->
eraser_thread
,
PlayedDataEraser
,
(
void
*
)
obj
,
int
ret
=
vlc_clone
(
&
sys
->
eraser_thread
,
PlayedDataEraser
,
(
void
*
)
obj
,
VLC_THREAD_PRIORITY_LOW
);
VLC_THREAD_PRIORITY_LOW
);
if
(
unlikely
(
ret
)
)
if
(
unlikely
(
ret
)
)
{
{
if
(
ret
!=
ENOMEM
)
if
(
ret
!=
ENOMEM
)
msg_Err
(
obj
,
"Couldn't start eraser thread"
);
msg_Err
(
obj
,
"Couldn't start eraser thread"
);
vlc_cond_destroy
(
&
sys
->
cond
);
vlc_mutex_destroy
(
&
sys
->
lock
);
if
(
sys
->
p_notify
!=
NULL
)
if
(
sys
->
p_notify
!=
NULL
)
{
{
IDirectSoundNotify_Release
(
sys
->
p_notify
);
IDirectSoundNotify_Release
(
sys
->
p_notify
);
...
@@ -1087,9 +1097,6 @@ static int Open(vlc_object_t *obj)
...
@@ -1087,9 +1097,6 @@ static int Open(vlc_object_t *obj)
aout_DeviceReport
(
aout
,
dev
);
aout_DeviceReport
(
aout
,
dev
);
free
(
dev
);
free
(
dev
);
vlc_mutex_init
(
&
sys
->
s
.
lock
);
vlc_cond_init
(
&
sys
->
s
.
cond
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -1097,8 +1104,6 @@ static void Close(vlc_object_t *obj)
...
@@ -1097,8 +1104,6 @@ static void Close(vlc_object_t *obj)
{
{
audio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
audio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
aout_sys_t
*
sys
=
aout
->
sys
;
aout_sys_t
*
sys
=
aout
->
sys
;
vlc_cond_destroy
(
&
sys
->
s
.
cond
);
vlc_mutex_destroy
(
&
sys
->
s
.
lock
);
var_Destroy
(
aout
,
"directx-audio-device"
);
var_Destroy
(
aout
,
"directx-audio-device"
);
FreeLibrary
(
sys
->
hdsound_dll
);
/* free DSOUND.DLL */
FreeLibrary
(
sys
->
hdsound_dll
);
/* free DSOUND.DLL */
...
...
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