X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess_output%2Fdummy.c;fp=modules%2Faccess_output%2Fdummy.c;h=3f9ee82fa716dc72c744fec94782cc2afdec9e4d;hb=298f0e468edf5cbbf05d852bb58c7ef762a6a571;hp=39f529ad75c2114016885eba287d3fa873cd9b11;hpb=1007fd93863262b3df3a066928ca7137fae9c46b;p=vlc diff --git a/modules/access_output/dummy.c b/modules/access_output/dummy.c index 39f529ad75..3f9ee82fa7 100644 --- a/modules/access_output/dummy.c +++ b/modules/access_output/dummy.c @@ -2,7 +2,7 @@ * dummy.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: dummy.c,v 1.3 2003/03/03 14:21:08 gbazin Exp $ + * $Id$ * * Authors: Laurent Aimar * Eric Petit @@ -26,32 +26,16 @@ * Preamble *****************************************************************************/ #include -#include -#include -#include -#include -#include #include -#include #include -#ifdef HAVE_UNISTD_H -# include -#endif - -/***************************************************************************** - * Exported prototypes - *****************************************************************************/ -static int Open ( vlc_object_t * ); -static void Close ( vlc_object_t * ); - -static int Write( sout_access_out_t *, sout_buffer_t * ); -static int Seek ( sout_access_out_t *, off_t ); - /***************************************************************************** * Module descriptor *****************************************************************************/ +static int Open ( vlc_object_t * ); +static void Close( vlc_object_t * ); + vlc_module_begin(); set_description( _("Dummy stream ouput") ); set_capability( "sout access", 0 ); @@ -60,6 +44,12 @@ vlc_module_begin(); vlc_module_end(); +/***************************************************************************** + * Exported prototypes + *****************************************************************************/ +static int Write( sout_access_out_t *, block_t * ); +static int Seek ( sout_access_out_t *, off_t ); + /***************************************************************************** * Open: open the file *****************************************************************************/ @@ -71,7 +61,7 @@ static int Open( vlc_object_t *p_this ) p_access->pf_write = Write; p_access->pf_seek = Seek; - msg_Info( p_access, "dummy stream output access launched" ); + msg_Dbg( p_access, "dummy stream output access opened" ); return VLC_SUCCESS; } @@ -81,28 +71,27 @@ static int Open( vlc_object_t *p_this ) static void Close( vlc_object_t * p_this ) { sout_access_out_t *p_access = (sout_access_out_t*)p_this; - msg_Info( p_access, "Close" ); + msg_Dbg( p_access, "dummy stream output access closed" ); } /***************************************************************************** * Read: standard read on a file descriptor. *****************************************************************************/ -static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) +static int Write( sout_access_out_t *p_access, block_t *p_buffer ) { - size_t i_write = 0; + int64_t i_write = 0; + block_t *b = p_buffer; - do + while( b ) { - sout_buffer_t *p_next; - i_write += p_buffer->i_size; - p_next = p_buffer->p_next; - sout_BufferDelete( p_access->p_sout, p_buffer ); - p_buffer = p_next; - } while( p_buffer ); + i_write += b->i_buffer; + + b = b->p_next; + } - msg_Dbg( p_access, "Dummy Skipped: len:"I64Fd, (int64_t)i_write ); + block_ChainRelease( p_buffer ); - return( i_write ); + return i_write; } /***************************************************************************** @@ -110,8 +99,7 @@ static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) *****************************************************************************/ static int Seek( sout_access_out_t *p_access, off_t i_pos ) { - msg_Dbg( p_access, "Seek: pos:"I64Fd, (int64_t)i_pos ); - return( 0 ); + return 0; }