From: Rémi Denis-Courmont Date: Thu, 15 Feb 2007 20:36:07 +0000 (+0000) Subject: HTTP and UDP access outputs return byte count X-Git-Tag: 0.9.0-test0~8569 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=839ae28b9e026e5271f902d5c827b321adf8b339;p=vlc HTTP and UDP access outputs return byte count --- diff --git a/THANKS b/THANKS index 694ac6c4b8..a011f06b28 100644 --- a/THANKS +++ b/THANKS @@ -133,6 +133,7 @@ Moritz Bunkus - Matroska patches Morten Brix Pedersen - Danish translation Nilmoni Deb - autoconf and Makefile fixes Olivier Aubert - clone list patch +Olivier Houchard - UDP & HTTP access output fix Olivier Pomel - original VLC code Ondrej Kuda aka Albert - HTTP interface tips and fixes Øyvind Kolbu - FreeBSD patches diff --git a/modules/access_output/http.c b/modules/access_output/http.c index 66099bb356..6de43253c6 100644 --- a/modules/access_output/http.c +++ b/modules/access_output/http.c @@ -374,6 +374,7 @@ 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_err = 0; + int i_len = 0; while( p_buffer ) { @@ -409,6 +410,7 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer ) p_sys->i_header_size ); } + i_len += p_buffer->i_buffer; /* send data */ i_err = httpd_StreamSend( p_sys->p_httpd_stream, p_buffer->p_buffer, p_buffer->i_buffer ); @@ -428,7 +430,7 @@ static int Write( sout_access_out_t *p_access, block_t *p_buffer ) block_ChainRelease( p_buffer ); } - return( i_err < 0 ? VLC_EGENERIC : VLC_SUCCESS ); + return( i_err < 0 ? VLC_EGENERIC : i_len ); } /***************************************************************************** diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c index 3ba7aa517e..890f7782f4 100644 --- a/modules/access_output/udp.c +++ b/modules/access_output/udp.c @@ -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 ); } /*****************************************************************************