[vlc-devel] commit: mmstu: handle keepalive error case (Jean-Paul Saman )

git version control git at videolan.org
Thu May 14 13:09:10 CEST 2009


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue May 12 14:11:30 2009 +0200| [e692b86ada5f970fb37b1db137a9d68148dc6ec2] | committer: Jean-Paul Saman 

mmstu: handle keepalive error case

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e692b86ada5f970fb37b1db137a9d68148dc6ec2
---

 modules/access/mms/mmstu.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 1ae4b90..f0d600f 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -201,6 +201,11 @@ int  MMSTUOpen( access_t *p_access )
 
     /* Keep the connection alive when paused */
     p_sys->p_keepalive = malloc( sizeof( mmstu_keepalive_t ) );
+    if( !p_sys->p_keepalive )
+    {
+        MMSTUClose ( p_access );
+        return VLC_ENOMEM;
+    }
     p_sys->p_keepalive->p_access = p_access;
     vlc_mutex_init( &p_sys->p_keepalive->lock );
     vlc_cond_init( &p_sys->p_keepalive->wait );
@@ -305,11 +310,14 @@ static int Control( access_t *p_access, int i_query, va_list args )
             else
                 Seek( p_access, p_access->info.i_pos );
 
-            vlc_mutex_lock( &p_sys->p_keepalive->lock );
-            p_sys->p_keepalive->b_paused = b_bool;
-            if( b_bool )
-                vlc_cond_signal( &p_sys->p_keepalive->wait );
-            vlc_mutex_unlock( &p_sys->p_keepalive->lock );
+            if( p_sys->p_keepalive )
+            {
+                vlc_mutex_lock( &p_sys->p_keepalive->lock );
+                p_sys->p_keepalive->b_paused = b_bool;
+                if( b_bool )
+                    vlc_cond_signal( &p_sys->p_keepalive->wait );
+                vlc_mutex_unlock( &p_sys->p_keepalive->lock );
+            }
             break;
 
         case ACCESS_GET_TITLE_INFO:




More information about the vlc-devel mailing list