[vlc-commits] mms: remove redundant vlc_object_alive() calls
Rémi Denis-Courmont
git at videolan.org
Wed Jun 3 22:11:05 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 3 23:09:26 2015 +0300| [032657a62b49bb9c351cf3626929a00d12b8bc1a] | committer: Rémi Denis-Courmont
mms: remove redundant vlc_object_alive() calls
If the input thread is killed, the net_* functions will return an
error. It gets propagated all the way up to where vlc_object_alive()
was checked.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=032657a62b49bb9c351cf3626929a00d12b8bc1a
---
modules/access/mms/mms.c | 6 +-----
modules/access/mms/mmsh.c | 2 +-
modules/access/mms/mmstu.c | 15 +++++----------
3 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/modules/access/mms/mms.c b/modules/access/mms/mms.c
index 5633c10..7f69d61 100644
--- a/modules/access/mms/mms.c
+++ b/modules/access/mms/mms.c
@@ -118,11 +118,7 @@ static int Open( vlc_object_t *p_this )
}
if( MMSTUOpen ( p_access ) )
- {
- if( !vlc_object_alive(p_access) )
- return VLC_EGENERIC;
-
- /* try mmsh if mmstu failed */
+ { /* try mmsh if mmstu failed */
return MMSHOpen ( p_access );
}
return VLC_SUCCESS;
diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c
index 30a47d4..8db5a2a 100644
--- a/modules/access/mms/mmsh.c
+++ b/modules/access/mms/mmsh.c
@@ -331,7 +331,7 @@ static int Seek( access_t *p_access, uint64_t i_pos )
Stop( p_access );
Start( p_access, i_packet * p_sys->asfh.i_min_data_packet_size );
- while( vlc_object_alive (p_access) )
+ for( ;; )
{
if( GetPacket( p_access, &ck ) )
break;
diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 4c974c4..b61c918 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -136,11 +136,9 @@ int MMSTUOpen( access_t *p_access )
/* connect */
if( i_proto == MMS_PROTO_AUTO )
{ /* first try with TCP and then UDP*/
- if( ( i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_TCP ) ) )
- {
- if( vlc_object_alive(p_access) )
- i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_UDP );
- }
+ i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_TCP );
+ if( i_status )
+ i_status = MMSOpen( p_access, &p_sys->url, MMS_PROTO_UDP );
}
else
{
@@ -341,7 +339,7 @@ static int Seek( access_t * p_access, uint64_t i_pos )
var_buffer_free( &buffer );
- while( vlc_object_alive (p_access) )
+ for( ;; )
{
if( mms_HeaderMediaRead( p_access, MMS_PACKET_CMD ) < 0 )
{
@@ -356,7 +354,7 @@ static int Seek( access_t * p_access, uint64_t i_pos )
}
}
- while( vlc_object_alive (p_access) )
+ for( ;; )
{
if( mms_HeaderMediaRead( p_access, MMS_PACKET_CMD ) < 0 )
{
@@ -1508,9 +1506,6 @@ static int mms_HeaderMediaRead( access_t *p_access, int i_type )
{
int i_status;
- if( !vlc_object_alive (p_access) )
- return -1;
-
i_status = mms_ReceivePacket( p_access );
if( i_status < 0 )
{
More information about the vlc-commits
mailing list