]> git.sesse.net Git - vlc/blobdiff - src/input/vlmshell.c
Made stream_t size and position unsigned.
[vlc] / src / input / vlmshell.c
index ba62608c1c9b4891bf9a9b11bf7343152e7d2ea8..590c8f47d1a7b61fca6a9cceac140d5828a2876d 100644 (file)
 
 #ifdef ENABLE_VLM
 
-#ifndef WIN32
-#   include <sys/time.h>                                   /* gettimeofday() */
-#endif
-
 #include <time.h>                                                 /* ctime() */
 
 #include <vlc_input.h>
 #include "input_internal.h"
 #include <vlc_stream.h>
 #include "vlm_internal.h"
-#include <vlc_vod.h>
 #include <vlc_charset.h>
 #include <vlc_sout.h>
 #include "../stream_output/stream_output.h"
@@ -566,7 +561,7 @@ error:
 static int ExecuteLoad( vlm_t *p_vlm, const char *psz_url, vlm_message_t **pp_status )
 {
     stream_t *p_stream = stream_UrlNew( p_vlm, psz_url );
-    int64_t i_size;
+    uint64_t i_size;
     char *psz_buffer;
 
     if( !p_stream )
@@ -585,6 +580,8 @@ static int ExecuteLoad( vlm_t *p_vlm, const char *psz_url, vlm_message_t **pp_st
     }
 
     i_size = stream_Size( p_stream );
+    if( i_size > SIZE_MAX - 1 )
+        i_size = SIZE_MAX - 1;
 
     psz_buffer = malloc( i_size + 1 );
     if( !psz_buffer )
@@ -641,7 +638,8 @@ static int ExecuteScheduleProperty( vlm_t *p_vlm, vlm_schedule_sys_t *p_schedule
             psz_line = strdup( ppsz_property[i] );
             for( j = i+1; j < i_property; j++ )
             {
-                psz_line = realloc( psz_line, strlen(psz_line) + strlen(ppsz_property[j]) + 1 + 1 );
+                psz_line = xrealloc( psz_line,
+                        strlen(psz_line) + strlen(ppsz_property[j]) + 1 + 1 );
                 strcat( psz_line, " " );
                 strcat( psz_line, ppsz_property[j] );
             }
@@ -1366,7 +1364,7 @@ static vlm_message_t *vlm_ShowMedia( vlm_media_sys_t *p_media )
             APPEND_INPUT_INFO( "position", "%f", Float );
             APPEND_INPUT_INFO( "time", "%"PRIi64, Time );
             APPEND_INPUT_INFO( "length", "%"PRIi64, Time );
-            APPEND_INPUT_INFO( "rate", "%d", Integer );
+            APPEND_INPUT_INFO( "rate", "%f", Float );
             APPEND_INPUT_INFO( "title", "%d", Integer );
             APPEND_INPUT_INFO( "chapter", "%d", Integer );
             APPEND_INPUT_INFO( "can-seek", "%d", Bool );