]> git.sesse.net Git - vlc/blobdiff - modules/access/mms/mmstu.c
Remove sys/types.h check
[vlc] / modules / access / mms / mmstu.c
index c3277220e366591e12720c92fc4390ce04aeb378..e2bc5f039d69d6e7ad5723a02dff8b86c16d477b 100644 (file)
 #ifdef HAVE_UNISTD_H
 #   include <unistd.h>
 #endif
-#ifdef HAVE_FCNTL_H
-#   include <fcntl.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#   include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#   include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#   include <sys/stat.h>
-#endif
+#include <sys/types.h>
 #ifdef HAVE_POLL
 #   include <poll.h>
 #endif
@@ -603,7 +592,7 @@ static int MMSOpen( access_t  *p_access, vlc_url_t *p_url, int  i_proto )
 #define GETUTF16( psz, size ) \
     { \
         int i; \
-        psz = malloc( size + 1); \
+        psz = xmalloc( size + 1); \
         for( i = 0; i < size; i++ ) \
         { \
             psz[i] = p[i]; \
@@ -814,9 +803,9 @@ static int MMSOpen( access_t  *p_access, vlc_url_t *p_url, int  i_proto )
                            p_sys->p_header, p_sys->i_header );
      asf_StreamSelect( &p_sys->asfh,
                            var_CreateGetInteger( p_access, "mms-maxbitrate" ),
-                           var_CreateGetInteger( p_access, "mms-all" ),
-                           var_CreateGetInteger( p_access, "audio" ),
-                           var_CreateGetInteger( p_access, "video" ) );
+                           var_CreateGetBool( p_access, "mms-all" ),
+                           var_InheritBool( p_access, "audio" ),
+                           var_InheritBool( p_access, "video" ) );
 
     /* *** now select stream we want to receive *** */
     /* TODO take care of stream bitrate TODO */
@@ -1185,7 +1174,7 @@ static int  mms_ParseCommand( access_t *p_access,
 
     free( p_sys->p_cmd );
     p_sys->i_cmd = i_data;
-    p_sys->p_cmd = malloc( i_data );
+    p_sys->p_cmd = xmalloc( i_data );
     memcpy( p_sys->p_cmd, p_data, i_data );
 
     *pi_used = i_data; /* by default */
@@ -1308,8 +1297,8 @@ static int  mms_ParsePacket( access_t *p_access,
     {
         if( p_sys->p_header )
         {
-            p_sys->p_header = realloc( p_sys->p_header,
-                                          p_sys->i_header + i_packet_length - 8 );
+            p_sys->p_header = xrealloc( p_sys->p_header,
+                                      p_sys->i_header + i_packet_length - 8 );
             memcpy( &p_sys->p_header[p_sys->i_header],
                     p_data + 8, i_packet_length - 8 );
             p_sys->i_header += i_packet_length - 8;
@@ -1317,7 +1306,7 @@ static int  mms_ParsePacket( access_t *p_access,
         }
         else
         {
-            uint8_t* p_packet = malloc( i_packet_length - 8 ); // don't bother with preheader
+            uint8_t* p_packet = xmalloc( i_packet_length - 8 ); // don't bother with preheader
             memcpy( p_packet, p_data + 8, i_packet_length - 8 );
             p_sys->p_header = p_packet;
             p_sys->i_header = i_packet_length - 8;
@@ -1330,7 +1319,7 @@ static int  mms_ParsePacket( access_t *p_access,
     }
     else
     {
-        uint8_t* p_packet = malloc( i_packet_length - 8 ); // don't bother with preheader
+        uint8_t* p_packet = xmalloc( i_packet_length - 8 ); // don't bother with preheader
         memcpy( p_packet, p_data + 8, i_packet_length - 8 );
         FREENULL( p_sys->p_media );
         p_sys->p_media = p_packet;