From: Laurent Aimar Date: Sun, 8 Feb 2009 15:52:27 +0000 (+0100) Subject: Added a missing block_BytestreamEmpty helper. X-Git-Tag: 1.0.0-pre1~789 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d042c1292f5f52bbfe4103e11b1706471cf6e8c8;p=vlc Added a missing block_BytestreamEmpty helper. --- diff --git a/include/vlc_block_helper.h b/include/vlc_block_helper.h index 376c2b4d75..654d26bc10 100644 --- a/include/vlc_block_helper.h +++ b/include/vlc_block_helper.h @@ -60,6 +60,19 @@ static inline void block_BytestreamRelease( block_bytestream_t *p_bytestream ) p_bytestream->p_chain = p_bytestream->p_block = NULL; } +/** + * It flush all data (read and unread) from a block_bytestream_t. + */ +static inline void block_BytestreamEmpty( block_bytestream_t *p_bytestream ) +{ + block_BytestreamRelease( p_bytestream ); + + *p_bytestream = block_BytestreamInit(); +} + +/** + * It flushes all already read data from a block_bytestream_t. + */ static inline void block_BytestreamFlush( block_bytestream_t *p_bytestream ) { while( p_bytestream->p_chain != p_bytestream->p_block )