]> git.sesse.net Git - vlc/commitdiff
Improved preroll in avcodec.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 14 Mar 2009 19:43:15 +0000 (20:43 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 14 Mar 2009 19:43:15 +0000 (20:43 +0100)
Do not decode non reference pictures while prerolling.
It improves seek performance when decoding with ffmpeg.

modules/codec/avcodec/video.c

index d28be2391a1ac16796031bc43be1545b29462ae4..2c9c8313bc93a762c3ce7b05826432e6fc319d47 100644 (file)
@@ -498,6 +498,11 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             p_sys->p_context->skip_frame = p_sys->i_skip_frame;
         b_null_size = true;
     }
+    else if( !b_drawpicture )
+    {
+        p_sys->p_context->skip_frame = __MAX( p_sys->p_context->skip_frame,
+                                              AVDISCARD_NONREF );
+    }
 
     /*
      * Do the actual decoding now
@@ -562,8 +567,9 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
 
         if( i_used < 0 )
         {
-            msg_Warn( p_dec, "cannot decode one frame (%d bytes)",
-                      p_sys->i_buffer );
+            if( b_drawpicture )
+                msg_Warn( p_dec, "cannot decode one frame (%d bytes)",
+                          p_sys->i_buffer );
             block_Release( p_block );
             return NULL;
         }