]> git.sesse.net Git - vlc/blobdiff - modules/access_output/udp.c
HTTP and UDP access outputs return byte count
[vlc] / modules / access_output / udp.c
index 3ba7aa517e2431d391b987bcf591cc418c850a30..890f7782f4d6b4fd3afffca29187ee33a77e5f37 100644 (file)
@@ -386,6 +386,7 @@ static void Close( vlc_object_t * p_this )
 static int 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;
 
     while( p_buffer )
     {
@@ -413,6 +414,7 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer )
             p_sys->p_buffer = NULL;
         }
 
+        i_len += p_buffer->i_buffer;
         while( p_buffer->i_buffer )
         {
             int i_payload_size = p_sys->i_mtu;
@@ -462,7 +464,7 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer )
         p_buffer = p_next;
     }
 
-    return( p_sys->p_thread->b_error ? -1 : 0 );
+    return( p_sys->p_thread->b_error ? -1 : i_len );
 }
 
 /*****************************************************************************
@@ -472,6 +474,7 @@ static int WriteRaw( sout_access_out_t *p_access, block_t *p_buffer )
 {
     sout_access_out_sys_t   *p_sys = p_access->p_sys;
     block_t *p_buf;
+    int i_len;
 
     while ( p_sys->p_thread->p_empty_blocks->i_depth >= MAX_EMPTY_BLOCKS )
     {
@@ -479,9 +482,10 @@ static int WriteRaw( sout_access_out_t *p_access, block_t *p_buffer )
         block_Release( p_buf );
     }
 
+    i_len = p_buffer->i_buffer;
     block_FifoPut( p_sys->p_thread->p_fifo, p_buffer );
 
-    return( p_sys->p_thread->b_error ? -1 : 0 );
+    return( p_sys->p_thread->b_error ? -1 : i_len );
 }
 
 /*****************************************************************************