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
c9f85df6
Commit
c9f85df6
authored
May 21, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted portaudio to vlc_clone() and fix vlc_cond_wait() usages.
parent
79e3f3bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/audio_output/portaudio.c
modules/audio_output/portaudio.c
+12
-12
No files found.
modules/audio_output/portaudio.c
View file @
c9f85df6
...
@@ -46,11 +46,11 @@
...
@@ -46,11 +46,11 @@
/*****************************************************************************
/*****************************************************************************
* aout_sys_t: portaudio audio output method descriptor
* aout_sys_t: portaudio audio output method descriptor
*****************************************************************************/
*****************************************************************************/
typedef
struct
pa_thread_t
typedef
struct
{
{
VLC_COMMON_MEMBERS
aout_instance_t
*
p_aout
;
aout_instance_t
*
p_aout
;
vlc_thread_t
thread
;
vlc_cond_t
wait
;
vlc_cond_t
wait
;
vlc_mutex_t
lock_wait
;
vlc_mutex_t
lock_wait
;
bool
b_wait
;
bool
b_wait
;
...
@@ -87,7 +87,7 @@ static const uint32_t pi_channels_out[] =
...
@@ -87,7 +87,7 @@ static const uint32_t pi_channels_out[] =
#ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN
#ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN
static
bool
b_init
=
0
;
static
bool
b_init
=
0
;
static
pa_thread_t
*
pa_thread
;
static
pa_thread_t
*
pa_thread
;
static
void
*
PORTAUDIOThread
(
v
lc_object_t
*
);
static
void
*
PORTAUDIOThread
(
v
oid
*
);
#endif
#endif
/*****************************************************************************
/*****************************************************************************
...
@@ -209,7 +209,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -209,7 +209,7 @@ static int Open( vlc_object_t * p_this )
b_init
=
true
;
b_init
=
true
;
/* Now we need to setup our DirectSound play notification structure */
/* Now we need to setup our DirectSound play notification structure */
pa_thread
=
vlc_object_create
(
p_aout
,
sizeof
(
pa_thread_t
)
);
pa_thread
=
calloc
(
1
,
sizeof
(
*
pa_thread
)
);
pa_thread
->
p_aout
=
p_aout
;
pa_thread
->
p_aout
=
p_aout
;
pa_thread
->
b_error
=
false
;
pa_thread
->
b_error
=
false
;
vlc_mutex_init
(
&
pa_thread
->
lock_wait
);
vlc_mutex_init
(
&
pa_thread
->
lock_wait
);
...
@@ -220,7 +220,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -220,7 +220,7 @@ static int Open( vlc_object_t * p_this )
pa_thread
->
b_signal
=
false
;
pa_thread
->
b_signal
=
false
;
/* Create PORTAUDIOThread */
/* Create PORTAUDIOThread */
if
(
vlc_
thread_create
(
pa_thread
,
PORTAUDIOT
hread
,
if
(
vlc_
clone
(
&
pa_thread
->
thread
,
PORTAUDIOThread
,
pa_t
hread
,
VLC_THREAD_PRIORITY_OUTPUT
)
)
VLC_THREAD_PRIORITY_OUTPUT
)
)
{
{
msg_Err
(
p_aout
,
"cannot create PORTAUDIO thread"
);
msg_Err
(
p_aout
,
"cannot create PORTAUDIO thread"
);
...
@@ -243,7 +243,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -243,7 +243,7 @@ static int Open( vlc_object_t * p_this )
/* Wait until thread is ready */
/* Wait until thread is ready */
vlc_mutex_lock
(
&
pa_thread
->
lock_wait
);
vlc_mutex_lock
(
&
pa_thread
->
lock_wait
);
if
(
!
pa_thread
->
b_wait
)
while
(
!
pa_thread
->
b_wait
)
vlc_cond_wait
(
&
pa_thread
->
wait
,
&
pa_thread
->
lock_wait
);
vlc_cond_wait
(
&
pa_thread
->
wait
,
&
pa_thread
->
lock_wait
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_wait
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_wait
);
pa_thread
->
b_wait
=
false
;
pa_thread
->
b_wait
=
false
;
...
@@ -296,7 +296,7 @@ static void Close ( vlc_object_t *p_this )
...
@@ -296,7 +296,7 @@ static void Close ( vlc_object_t *p_this )
/* Wait until thread is ready */
/* Wait until thread is ready */
vlc_mutex_lock
(
&
pa_thread
->
lock_wait
);
vlc_mutex_lock
(
&
pa_thread
->
lock_wait
);
if
(
!
pa_thread
->
b_wait
)
while
(
!
pa_thread
->
b_wait
)
vlc_cond_wait
(
&
pa_thread
->
wait
,
&
pa_thread
->
lock_wait
);
vlc_cond_wait
(
&
pa_thread
->
wait
,
&
pa_thread
->
lock_wait
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_wait
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_wait
);
pa_thread
->
b_wait
=
false
;
pa_thread
->
b_wait
=
false
;
...
@@ -567,19 +567,19 @@ static void Play( aout_instance_t * p_aout )
...
@@ -567,19 +567,19 @@ static void Play( aout_instance_t * p_aout )
* PORTAUDIOThread: all interactions with libportaudio.a are handled
* PORTAUDIOThread: all interactions with libportaudio.a are handled
* in this single thread. Otherwise libportaudio.a is _not_ happy :-(
* in this single thread. Otherwise libportaudio.a is _not_ happy :-(
*****************************************************************************/
*****************************************************************************/
static
void
*
PORTAUDIOThread
(
v
lc_object_t
*
p_this
)
static
void
*
PORTAUDIOThread
(
v
oid
*
data
)
{
{
pa_thread_t
*
pa_thread
=
(
pa_thread_t
*
)
p_this
;
pa_thread_t
*
pa_thread
=
(
pa_thread_t
*
)
data
;
aout_instance_t
*
p_aout
;
aout_instance_t
*
p_aout
;
aout_sys_t
*
p_sys
;
aout_sys_t
*
p_sys
;
int
i_err
;
int
i_err
;
int
canc
=
vlc_savecancel
();
int
canc
=
vlc_savecancel
();
while
(
vlc_object_alive
(
pa_thread
)
)
for
(
;;
)
{
{
/* Wait for start of stream */
/* Wait for start of stream */
vlc_mutex_lock
(
&
pa_thread
->
lock_signal
);
vlc_mutex_lock
(
&
pa_thread
->
lock_signal
);
if
(
!
pa_thread
->
b_signal
)
while
(
!
pa_thread
->
b_signal
)
vlc_cond_wait
(
&
pa_thread
->
signal
,
&
pa_thread
->
lock_signal
);
vlc_cond_wait
(
&
pa_thread
->
signal
,
&
pa_thread
->
lock_signal
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_signal
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_signal
);
pa_thread
->
b_signal
=
false
;
pa_thread
->
b_signal
=
false
;
...
@@ -614,7 +614,7 @@ static void* PORTAUDIOThread( vlc_object_t *p_this )
...
@@ -614,7 +614,7 @@ static void* PORTAUDIOThread( vlc_object_t *p_this )
/* Wait for end of stream */
/* Wait for end of stream */
vlc_mutex_lock
(
&
pa_thread
->
lock_signal
);
vlc_mutex_lock
(
&
pa_thread
->
lock_signal
);
if
(
!
pa_thread
->
b_signal
)
while
(
!
pa_thread
->
b_signal
)
vlc_cond_wait
(
&
pa_thread
->
signal
,
&
pa_thread
->
lock_signal
);
vlc_cond_wait
(
&
pa_thread
->
signal
,
&
pa_thread
->
lock_signal
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_signal
);
vlc_mutex_unlock
(
&
pa_thread
->
lock_signal
);
pa_thread
->
b_signal
=
false
;
pa_thread
->
b_signal
=
false
;
...
...
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