X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=plugins%2Fmpeg_system%2Finput_es.c;h=700a61e82e1996bc2a41bd2f44b748b24cd795cf;hb=ca6c02a2e3674479b5ef7954f7c190def7f091bf;hp=afa78ed3ea9600a6004d22cc65b894e38a61f749;hpb=9fb2aad3b034ec585524f74998e4132e8d5c5b77;p=vlc diff --git a/plugins/mpeg_system/input_es.c b/plugins/mpeg_system/input_es.c index afa78ed3ea..700a61e82e 100644 --- a/plugins/mpeg_system/input_es.c +++ b/plugins/mpeg_system/input_es.c @@ -2,7 +2,7 @@ * input_es.c: Elementary Stream demux and packet management ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: input_es.c,v 1.9 2001/12/29 03:07:51 massiot Exp $ + * $Id: input_es.c,v 1.10 2001/12/30 04:26:53 sam Exp $ * * Author: Christophe Massiot * @@ -222,15 +222,13 @@ static int ESRead( input_thread_t * p_input, * back to the buffer allocator. */ int i_loop; - for( i_loop = 0; i_loop + 1 < i_read; i_loop++ ) + for( i_loop = 0; i_loop < i_read; i_loop++ ) { - p_data = p_data->p_next; - } - p_input->pf_delete_packet( p_input->p_method_data, p_data->p_next ); - if( i_read != 0 ) - { - p_data->p_next = NULL; + pp_data = &(*pp_data)->p_next; } + + p_input->pf_delete_packet( p_input->p_method_data, *pp_data ); + *pp_data = NULL; } return( i_read );