[vlc-devel] [PATCH 8/9] avcodec: video: remove i_used variable as send_packet consumes all

ileoo at videolan.org ileoo at videolan.org
Sun Sep 4 14:34:08 CEST 2016


From: Ilkka Ollakka <ileoo at videolan.org>

---
 modules/codec/avcodec/video.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 83bb454..b59e7fa 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -855,23 +855,9 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             if( p_block->i_buffer <= 0 )
                 p_sys->b_flush = false;
 
-            if( i_used < 0 )
-            {
-                av_frame_free(&frame);
-                if( b_need_output_picture )
-                    msg_Warn( p_dec, "cannot decode one frame (%zu bytes)",
-                            p_block->i_buffer );
-                break;
-            }
-            else if( (unsigned)i_used > p_block->i_buffer ||
-                    p_context->thread_count > 1 )
-            {
-                i_used = p_block->i_buffer;
-            }
-
             /* Consumed bytes */
-            p_block->i_buffer -= i_used;
-            p_block->p_buffer += i_used;
+            p_block->p_buffer += p_block->i_buffer;
+            p_block->i_buffer = 0;
         }
 
         /* Nothing to display */
-- 
2.6.6



More information about the vlc-devel mailing list