vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Thu Jul 23 22:41:12 2015 +0300| [c7e83e1cee37ff123349f8d679e4d825f0c3b91b] | committer: Rémi Denis-Courmont
stream: remove stream_BlockRemaining() > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7e83e1cee37ff123349f8d679e4d825f0c3b91b --- include/vlc_stream.h | 1 - src/input/stream.c | 44 -------------------------------------------- src/libvlccore.sym | 1 - 3 files changed, 46 deletions(-) diff --git a/include/vlc_stream.h b/include/vlc_stream.h index bca0d9a..d74b817 100644 --- a/include/vlc_stream.h +++ b/include/vlc_stream.h @@ -118,7 +118,6 @@ VLC_API int stream_vaControl( stream_t *s, int i_query, va_list args ); VLC_API void stream_Delete( stream_t *s ); VLC_API int stream_Control( stream_t *s, int i_query, ... ); VLC_API block_t * stream_Block( stream_t *s, int i_size ); -VLC_API block_t * stream_BlockRemaining( stream_t *s, int i_max_size ); VLC_API char * stream_ReadLine( stream_t * ); VLC_API input_item_t *stream_ReadDir( stream_t * ); diff --git a/src/input/stream.c b/src/input/stream.c index 2d41523..dfc1604 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -523,50 +523,6 @@ block_t *stream_Block( stream_t *s, int i_size ) } /** - * Read the remaining of the data if there is less than i_max_size bytes, otherwise - * return NULL. - * - * The stream position is unknown after the call. - */ -block_t *stream_BlockRemaining( stream_t *s, int i_max_size ) -{ - int i_allocate = __MIN(1000000, i_max_size); - int64_t i_size = stream_Size( s ); - if( i_size > 0 ) - { - int64_t i_position = stream_Tell( s ); - if( i_position + i_max_size < i_size ) - { - msg_Err( s, "Remaining stream size is greater than %d bytes", - i_max_size ); - return NULL; - } - i_allocate = i_size - i_position; - } - if( i_allocate <= 0 ) - return NULL; - - block_t *p_block = block_Alloc( i_allocate ); - int i_index = 0; - while( p_block ) - { - int i_read = stream_Read( s, &p_block->p_buffer[i_index], - p_block->i_buffer - i_index); - if( i_read <= 0 ) - break; - i_index += i_read; - i_max_size -= i_read; - if( i_max_size <= 0 ) - break; - p_block = block_Realloc( p_block, 0, p_block->i_buffer + - __MIN(1000000, i_max_size) ); - } - if( p_block ) - p_block->i_buffer = i_index; - return p_block; -} - -/** * Read the next input_item_t from the directory stream. It returns the next * input item on success or NULL in case of error or end of stream. The item * must be released with input_item_Release. diff --git a/src/libvlccore.sym b/src/libvlccore.sym index d390934..e740822 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -393,7 +393,6 @@ spu_Render spu_RegisterChannel spu_ClearChannel stream_Block -stream_BlockRemaining stream_Control stream_Delete stream_DemuxNew _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
