]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/raop.c
transcode: refactor littlebit video-encoding
[vlc] / modules / stream_out / raop.c
index f4cf3c48080cfa992284f6a05cfe5d7457f959b6..c7e5a041f1e15faa42078904357a018fc892f857 100644 (file)
 #include <vlc_network.h>
 #include <vlc_strings.h>
 #include <vlc_charset.h>
+#include <vlc_fs.h>
 #include <vlc_gcrypt.h>
 #include <vlc_es.h>
 #include <vlc_http.h>
+#include <vlc_memory.h>
 
 #define RAOP_PORT 5000
 #define RAOP_USER_AGENT "VLC " VERSION
@@ -546,7 +548,7 @@ static char *ReadPasswordFile( vlc_object_t *p_this, const char *psz_path )
     char *psz_newline;
     char ps_buffer[256];
 
-    p_file = utf8_fopen( psz_path, "rt" );
+    p_file = vlc_fopen( psz_path, "rt" );
     if ( p_file == NULL )
     {
         msg_Err( p_this, "Unable to open password file '%s': %m", psz_path );
@@ -575,7 +577,7 @@ static char *ReadPasswordFile( vlc_object_t *p_this, const char *psz_path )
             *psz_newline = '\0';
     }
 
-    if ( strlen( ps_buffer ) == 0 ) {
+    if ( *ps_buffer == '\0' ) {
         msg_Err( p_this, "No password could be read from '%s'", psz_path );
         goto error;
     }
@@ -1299,7 +1301,7 @@ static void SendAudio( sout_stream_t *p_stream, block_t *p_buffer )
             /* Grow in blocks of 4K */
             i_realloc_len = (1 + (i_len / 4096)) * 4096;
 
-            p_sys->p_sendbuf = realloc( p_sys->p_sendbuf, i_realloc_len );
+            p_sys->p_sendbuf = realloc_or_free( p_sys->p_sendbuf, i_realloc_len );
             if ( p_sys->p_sendbuf == NULL )
                 goto error;