]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/standard.c
Qt coverlabel should always show an image, even when load fails
[vlc] / modules / stream_out / standard.c
index a7c5d24904372fd5d21905f1c3e227ed80dc2712..7262eab383a7b93a6ffaa42db4f57028cc8cfb3f 100644 (file)
@@ -28,8 +28,8 @@
 # include "config.h"
 #endif
 
-#ifdef WIN32
-# define _WIN32_WINNT 0x0501
+#ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0500
 #endif
 
 #include <vlc_common.h>
@@ -411,23 +411,20 @@ static int Open( vlc_object_t *p_this )
         char *dhost = var_GetNonEmptyString (p_access, "dst-addr");
         int sport = var_GetInteger (p_access, "src-port");
         int dport = var_GetInteger (p_access, "dst-port");
-        char port[6];
         struct sockaddr_storage src, dst;
         socklen_t srclen = 0, dstlen = 0;
         struct addrinfo *res;
 
-        snprintf (port, sizeof (port), "%d", dport);
-        if (getaddrinfo (dhost, port, &hints, &res) == 0)
+        if ( vlc_getaddrinfo ( VLC_OBJECT(p_stream), dhost, dport, &hints, &res) == 0)
         {
             memcpy (&dst, res->ai_addr, dstlen = res->ai_addrlen);
-            freeaddrinfo (res);
+            vlc_freeaddrinfo (res);
         }
 
-        snprintf (port, sizeof (port), "%d", sport);
-        if (getaddrinfo (shost, port, &hints, &res) == 0)
+        if (vlc_getaddrinfo ( VLC_OBJECT(p_stream), shost, sport, &hints, &res) == 0)
         {
             memcpy (&src, res->ai_addr, srclen = res->ai_addrlen);
-            freeaddrinfo (res);
+            vlc_freeaddrinfo (res);
         }
 
         char *head = vlc_sdp_Start (VLC_OBJECT (p_stream), SOUT_CFG_PREFIX,
@@ -468,6 +465,9 @@ static int Open( vlc_object_t *p_this )
     free( psz_mux );
     free( psz_url );
 
+    if( !sout_AccessOutCanControlPace( p_access ) )
+        p_sout->i_out_pace_nocontrol++;
+
     return VLC_SUCCESS;
 }
 
@@ -484,6 +484,8 @@ static void Close( vlc_object_t * p_this )
         sout_AnnounceUnRegister( p_stream->p_sout, p_sys->p_session );
 
     sout_MuxDelete( p_sys->p_mux );
+    if( !sout_AccessOutCanControlPace( p_access ) )
+        p_stream->p_sout->i_out_pace_nocontrol--;
     sout_AccessOutDelete( p_access );
 
     free( p_sys );
@@ -501,10 +503,12 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     sout_stream_id_t  *id;
 
     id = malloc( sizeof( sout_stream_id_t ) );
+    if( !id )
+        return NULL;
+
     if( ( id->p_input = sout_MuxAddStream( p_sys->p_mux, p_fmt ) ) == NULL )
     {
         free( id );
-
         return NULL;
     }