Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
00b95848
Commit
00b95848
authored
Jul 05, 2008
by
Rémi Denis-Courmont
Browse files
modules: use vlc_object_alive()
parent
d10dffca
Changes
84
Hide whitespace changes
Inline
Side-by-side
modules/access/bda/bda.c
View file @
00b95848
...
...
@@ -548,7 +548,7 @@ static block_t *Block( access_t *p_access )
block_t
*
p_block
;
long
l_buffer_len
;
if
(
p_access
->
b_die
)
if
(
!
vlc_object_alive
(
p_access
)
)
return
NULL
;
l_buffer_len
=
dvb_GetBufferSize
(
p_access
);
...
...
modules/access/dshow/dshow.cpp
View file @
00b95848
...
...
@@ -1639,7 +1639,7 @@ static block_t *ReadCompressed( access_t *p_access )
while
(
1
)
{
if
(
p_access
->
b_die
||
p_access
->
b_error
)
return
0
;
if
(
!
vlc_object_alive
(
p_access
)
||
p_access
->
b_error
)
return
0
;
/* Get new sample/frame from the elementary stream (blocking). */
vlc_mutex_lock
(
&
p_sys
->
lock
);
...
...
modules/access/dv.c
View file @
00b95848
...
...
@@ -368,7 +368,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
vlc_thread_ready
(
p_this
);
while
(
!
p_sys
->
p_ev
->
b_die
)
while
(
vlc_object_alive
(
p_sys
->
p_ev
)
)
{
while
(
(
result
=
poll
(
&
(
p_sys
->
raw1394_poll
),
1
,
200
)
)
<
0
)
{
...
...
@@ -380,7 +380,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
if
(
p_sys
->
p_ev
->
b_die
)
break
;
}
if
(
p_sys
->
p_ev
->
b_die
)
if
(
!
vlc_object_alive
(
p_sys
->
p_ev
)
)
break
;
if
(
result
>
0
&&
(
(
p_sys
->
raw1394_poll
.
revents
&
POLLIN
)
||
(
p_sys
->
raw1394_poll
.
revents
&
POLLPRI
)
)
)
...
...
modules/access/dvb/access.c
View file @
00b95848
...
...
@@ -430,7 +430,7 @@ static block_t *Block( access_t *p_access )
/* Find if some data is available */
i_ret
=
poll
(
ufds
,
2
,
500
);
if
(
p_access
->
b_die
)
if
(
!
vlc_object_alive
(
p_access
)
)
return
NULL
;
if
(
i_ret
<
0
)
...
...
modules/access/dvb/en50221.c
View file @
00b95848
...
...
@@ -1910,7 +1910,7 @@ int en50221_Init( access_t * p_access )
#if HLCI_WAIT_CAM_READY
while
(
ca_msg
.
msg
[
8
]
==
0xff
&&
ca_msg
.
msg
[
9
]
==
0xff
)
{
if
(
p_access
->
b_die
)
return
VLC_EGENERIC
;
if
(
!
vlc_object_alive
(
p_access
)
)
return
VLC_EGENERIC
;
msleep
(
1
);
msg_Dbg
(
p_access
,
"CAM: please wait"
);
APDUSend
(
p_access
,
1
,
AOT_APPLICATION_INFO_ENQ
,
NULL
,
0
);
...
...
modules/access/dvdnav.c
View file @
00b95848
...
...
@@ -1234,7 +1234,7 @@ static int EventThread( vlc_object_t *p_this )
var_AddCallback
(
p_ev
->
p_libvlc
,
"key-action"
,
EventKey
,
p_ev
);
/* main loop */
while
(
!
p_ev
->
b_die
)
while
(
vlc_object_alive
(
p_ev
)
)
{
bool
b_activated
=
false
;
...
...
@@ -1297,7 +1297,7 @@ static int EventThread( vlc_object_t *p_this )
p_ev
->
b_clicked
=
false
;
vlc_mutex_unlock
(
&
p_ev
->
lock
);
}
if
(
p_vout
&&
p_vout
->
b_die
)
if
(
p_vout
&&
!
vlc_object_alive
(
p_vout
)
)
{
var_DelCallback
(
p_vout
,
"mouse-moved"
,
EventMouse
,
p_ev
);
var_DelCallback
(
p_vout
,
"mouse-clicked"
,
EventMouse
,
p_ev
);
...
...
modules/access/http.c
View file @
00b95848
...
...
@@ -415,7 +415,7 @@ connect:
p_sys
->
i_version
=
0
;
p_sys
->
b_seekable
=
false
;
if
(
p_access
->
b_die
||
Connect
(
p_access
,
0
)
)
if
(
!
vlc_object_alive
(
p_access
)
||
Connect
(
p_access
,
0
)
)
goto
error
;
#ifndef NDEBUG
...
...
@@ -1079,7 +1079,7 @@ static int Connect( access_t *p_access, int64_t i_tell )
free
(
psz
);
if
(
p_access
->
b_die
||
p_access
->
b_error
)
if
(
!
vlc_object_alive
(
p_access
)
||
p_access
->
b_error
)
{
Disconnect
(
p_access
);
return
-
1
;
...
...
@@ -1265,7 +1265,7 @@ static int Request( access_t *p_access, int64_t i_tell )
goto
error
;
}
if
(
p_access
->
b_die
||
p_access
->
b_error
)
if
(
!
vlc_object_alive
(
p_access
)
||
p_access
->
b_error
)
{
free
(
psz
);
goto
error
;
...
...
modules/access/mms/mmsh.c
View file @
00b95848
...
...
@@ -326,7 +326,7 @@ static int Seek( access_t *p_access, int64_t i_pos )
Stop
(
p_access
);
Start
(
p_access
,
i_packet
*
p_sys
->
asfh
.
i_min_data_packet_size
);
while
(
!
p_access
->
b_die
)
while
(
vlc_object_alive
(
p_access
)
)
{
msg_Warn
(
p_access
,
"GetPacket 1"
);
if
(
GetPacket
(
p_access
,
&
ck
)
)
...
...
modules/access/mms/mmstu.c
View file @
00b95848
...
...
@@ -389,7 +389,7 @@ static int Seek( access_t * p_access, int64_t i_pos )
var_buffer_free
(
&
buffer
);
while
(
!
p_access
->
b_die
)
while
(
vlc_object_alive
(
p_access
)
)
{
if
(
mms_HeaderMediaRead
(
p_access
,
MMS_PACKET_CMD
)
<
0
)
{
...
...
@@ -404,7 +404,7 @@ static int Seek( access_t * p_access, int64_t i_pos )
}
}
while
(
!
p_access
->
b_die
)
while
(
vlc_object_alive
(
p_access
)
)
{
if
(
mms_HeaderMediaRead
(
p_access
,
MMS_PACKET_CMD
)
<
0
)
{
...
...
@@ -1116,7 +1116,7 @@ static int NetFillBuffer( access_t *p_access )
return
-
1
;
}
if
(
p_access
->
b_die
||
p_access
->
b_error
)
return
-
1
;
if
(
!
vlc_object_alive
(
p_access
)
||
p_access
->
b_error
)
return
-
1
;
//msg_Dbg( p_access, "NetFillBuffer: trying again (select)" );
...
...
@@ -1552,7 +1552,7 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
{
int
i_status
;
if
(
p_access
->
b_die
)
if
(
!
vlc_object_alive
(
p_access
)
)
return
-
1
;
i_status
=
mms_ReceivePacket
(
p_access
);
...
...
modules/access/pvr.c
View file @
00b95848
...
...
@@ -1083,7 +1083,7 @@ static ssize_t Read( access_t * p_access, uint8_t * p_buffer, size_t i_len )
do
{
if
(
p_access
->
b_die
)
if
(
!
vlc_object_alive
(
p_access
)
)
return
0
;
ufd
.
revents
=
0
;
...
...
modules/access/rtmp/access.c
View file @
00b95848
...
...
@@ -311,7 +311,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
while
(
i_len_tmp
<
i_len
)
{
if
(
p_sys
->
p_thread
->
result_stop
||
p_access
->
info
.
b_eof
||
p_access
->
b_die
)
if
(
p_sys
->
p_thread
->
result_stop
||
p_access
->
info
.
b_eof
||
!
vlc_object_alive
(
p_access
)
)
{
p_access
->
info
.
b_eof
=
true
;
return
0
;
...
...
@@ -510,7 +510,7 @@ static void ThreadControl( vlc_object_t *p_this )
rtmp_init_handler
(
p_thread
->
rtmp_handler
);
while
(
!
p_thread
->
b_die
)
while
(
vlc_object_alive
(
p_thread
)
)
{
rtmp_packet
=
rtmp_read_net_packet
(
p_thread
);
if
(
rtmp_packet
!=
NULL
)
...
...
modules/access/v4l.c
View file @
00b95848
...
...
@@ -1440,7 +1440,7 @@ static uint8_t *GrabCapture( demux_t *p_demux )
return
NULL
;
}
if
(
p_demux
->
b_die
)
if
(
!
vlc_object_alive
(
p_demux
)
)
{
return
NULL
;
}
...
...
modules/access/v4l2/v4l2.c
View file @
00b95848
...
...
@@ -1323,7 +1323,7 @@ static ssize_t AccessRead( access_t * p_access, uint8_t * p_buffer, size_t i_len
do
{
if
(
p_access
->
b_die
)
if
(
!
vlc_object_alive
(
p_access
)
)
return
0
;
ufd
.
revents
=
0
;
...
...
modules/access/vcdx/intf.c
View file @
00b95848
...
...
@@ -124,7 +124,7 @@ RunIntf( intf_thread_t *p_intf )
dbg_print
(
INPUT_DBG_CALL
,
"intf initialized"
);
/* Main loop */
while
(
!
p_intf
->
b_die
)
while
(
vlc_object_alive
(
p_intf
)
)
{
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
...
...
@@ -317,7 +317,7 @@ RunIntf( intf_thread_t *p_intf )
static
int
InitThread
(
intf_thread_t
*
p_intf
)
{
/* We might need some locking here */
if
(
!
p_intf
->
b_die
)
if
(
vlc_object_alive
(
p_intf
)
)
{
input_thread_t
*
p_input
;
...
...
modules/access_filter/timeshift.c
View file @
00b95848
...
...
@@ -275,7 +275,7 @@ static void Thread( access_t *p_access )
access_t
*
p_src
=
p_access
->
p_source
;
block_t
*
p_block
;
while
(
!
p_access
->
b_die
)
while
(
vlc_object_alive
(
p_access
)
)
{
/* Get a new block from the source */
if
(
p_src
->
pf_block
)
...
...
@@ -320,7 +320,7 @@ static void Thread( access_t *p_access )
/* Read from file to fill up the fifo */
while
(
block_FifoSize
(
p_sys
->
p_fifo
)
<
TIMESHIFT_FIFO_MIN
&&
!
p_access
->
b_die
)
vlc_object_alive
(
p_access
)
)
{
p_block
=
ReadBlockFromFile
(
p_access
);
if
(
!
p_block
)
break
;
...
...
@@ -331,12 +331,12 @@ static void Thread( access_t *p_access )
msg_Dbg
(
p_access
,
"timeshift: no more input data"
);
while
(
!
p_access
->
b_die
&&
while
(
vlc_object_alive
(
p_access
)
&&
(
p_sys
->
p_read_list
||
block_FifoSize
(
p_sys
->
p_fifo
)
)
)
{
/* Read from file to fill up the fifo */
while
(
block_FifoSize
(
p_sys
->
p_fifo
)
<
TIMESHIFT_FIFO_MIN
&&
!
p_access
->
b_die
&&
p_sys
->
p_read_list
)
vlc_object_alive
(
p_access
)
&&
p_sys
->
p_read_list
)
{
p_block
=
ReadBlockFromFile
(
p_access
);
if
(
!
p_block
)
break
;
...
...
modules/access_output/bonjour.c
View file @
00b95848
...
...
@@ -185,7 +185,7 @@ static void poll_iterate_thread( poll_thread_t *p_pt )
{
vlc_thread_ready
(
p_pt
);
while
(
!
p_pt
->
b_die
)
while
(
vlc_object_alive
(
p_pt
)
)
if
(
avahi_simple_poll_iterate
(
p_pt
->
simple_poll
,
100
)
!=
0
)
break
;
}
...
...
modules/access_output/rtmp.c
View file @
00b95848
...
...
@@ -386,7 +386,7 @@ static void ThreadControl( vlc_object_t *p_this )
rtmp_init_handler
(
p_thread
->
rtmp_handler
);
while
(
!
p_thread
->
b_die
)
while
(
vlc_object_alive
(
p_thread
)
)
{
rtmp_packet
=
rtmp_read_net_packet
(
p_thread
);
if
(
rtmp_packet
!=
NULL
)
...
...
modules/access_output/udp.c
View file @
00b95848
...
...
@@ -444,7 +444,7 @@ static void ThreadWrite( vlc_object_t *p_this )
mtime_t
i_to_send
=
p_thread
->
i_group
;
int
i_dropped_packets
=
0
;
while
(
!
p_thread
->
b_die
)
while
(
vlc_object_alive
(
p_thread
)
)
{
block_t
*
p_pk
;
mtime_t
i_date
,
i_sent
;
...
...
modules/audio_output/alsa.c
View file @
00b95848
...
...
@@ -764,16 +764,16 @@ static int ALSAThread( aout_instance_t * p_aout )
/* Wait for the exact time to start playing (avoids resampling) */
vlc_mutex_lock
(
&
p_sys
->
lock
);
while
(
!
p_sys
->
start_date
&&
!
p_aout
->
b_die
)
while
(
!
p_sys
->
start_date
&&
vlc_object_alive
(
p_aout
)
)
vlc_cond_wait
(
&
p_sys
->
wait
,
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
if
(
p_aout
->
b_die
)
if
(
!
vlc_object_alive
(
p_aout
)
)
goto
cleanup
;
mwait
(
p_sys
->
start_date
-
AOUT_PTS_TOLERANCE
/
4
);
while
(
!
p_aout
->
b_die
)
while
(
vlc_object_alive
(
p_aout
)
)
{
ALSAFill
(
p_aout
);
}
...
...
@@ -876,7 +876,7 @@ static void ALSAFill( aout_instance_t * p_aout )
* (stream is suspended and waiting for an application recovery) */
msg_Dbg
(
p_aout
,
"entering in suspend mode, trying to resume..."
);
while
(
!
p_aout
->
b_die
&&
!
p_aout
->
p_libvlc
->
b_die
&&
while
(
vlc_object_alive
(
p_aout
)
&&
vlc_object_alive
(
p_aout
->
p_libvlc
)
&&
(
i_snd_rc
=
snd_pcm_resume
(
p_sys
->
p_snd_pcm
)
)
==
-
EAGAIN
)
{
msleep
(
1000000
);
...
...
modules/audio_output/directx.c
View file @
00b95848
...
...
@@ -1064,7 +1064,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
/* Wait here until Play() is called */
WaitForSingleObject
(
p_notif
->
event
,
INFINITE
);
if
(
!
p_notif
->
b_die
)
if
(
vlc_object_alive
(
p_notif
)
)
{
mwait
(
p_notif
->
start_date
-
AOUT_PTS_TOLERANCE
/
2
);
...
...
@@ -1089,7 +1089,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
}
last_time
=
mdate
();
while
(
!
p_notif
->
b_die
)
while
(
vlc_object_alive
(
p_notif
)
)
{
long
l_read
,
l_free_slots
;
mtime_t
mtime
=
mdate
();
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
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