]> git.sesse.net Git - vlc/blobdiff - modules/access_output/udp.c
Added import of configuration file support
[vlc] / modules / access_output / udp.c
index 1ec9f39e0cc4a2e929ef8a5859f765157bfb0ef7..4d9ad69da005785a268552ab75fa5883d3b0b8cc 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 
 #include <sys/types.h>
 
 #define MAX_EMPTY_BLOCKS 200
 
-#if defined(WIN32) || defined(UNDER_CE)
-# define WINSOCK_STRERROR_SIZE 20
-static const char *winsock_strerror( char *buf )
-{
-    snprintf( buf, WINSOCK_STRERROR_SIZE, "Winsock error %d",
-              WSAGetLastError( ) );
-    buf[WINSOCK_STRERROR_SIZE - 1] = '\0';
-    return buf;
-}
-#endif
-
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -123,7 +116,7 @@ static const char *const ppsz_core_options[] = {
     NULL
 };
 
-static int  Write   ( sout_access_out_t *, block_t * );
+static ssize_t Write   ( sout_access_out_t *, block_t * );
 static int  Seek    ( sout_access_out_t *, off_t  );
 
 static void ThreadWrite( vlc_object_t * );
@@ -158,7 +151,6 @@ struct sout_access_out_sys_t
 };
 
 #define DEFAULT_PORT 1234
-#define RTP_HEADER_LENGTH 12
 
 /*****************************************************************************
  * Open: open the file
@@ -239,7 +231,7 @@ static int Open( vlc_object_t *p_this )
     if( i_handle == -1 )
     {
          msg_Err( p_access, "failed to create raw UDP socket" );
-         vlc_object_destroy (p_sys->p_thread);
+         vlc_object_release (p_sys->p_thread);
          free (p_sys);
          return VLC_EGENERIC;
     }
@@ -278,7 +270,7 @@ static int Open( vlc_object_t *p_this )
     {
         msg_Err( p_access->p_sout, "cannot spawn sout access thread" );
         net_Close (i_handle);
-        vlc_object_destroy( p_sys->p_thread );
+        vlc_object_release( p_sys->p_thread );
         free (p_sys);
         return VLC_EGENERIC;
     }
@@ -323,7 +315,7 @@ static void Close( vlc_object_t * p_this )
     net_Close( p_sys->p_thread->i_handle );
 
     vlc_object_detach( p_sys->p_thread );
-    vlc_object_destroy( p_sys->p_thread );
+    vlc_object_release( p_sys->p_thread );
     /* update p_sout->i_out_pace_nocontrol */
     p_access->p_sout->i_out_pace_nocontrol--;
 
@@ -334,7 +326,7 @@ static void Close( vlc_object_t * p_this )
 /*****************************************************************************
  * Write: standard write on a file descriptor.
  *****************************************************************************/
-static int Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     int i_len = 0;
@@ -575,5 +567,3 @@ static const char *MakeRandMulticast (int family, char *buf, size_t buflen)
 #endif
     return NULL;
 }
-
-