]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Enable dropping frames for RV3/4
authorkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 14 Feb 2009 06:38:50 +0000 (06:38 +0000)
committerkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 14 Feb 2009 06:38:50 +0000 (06:38 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17221 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/rv34.c

index 820fb22b211b1885ae1d26285a1ef70ad84aa871..607a92837cd2e5a017fa3c0671a7fa9c28660bce 100644 (file)
@@ -1408,6 +1408,15 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
     }
     if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
         return -1;
+    /* skip b frames if we are in a hurry */
+    if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size;
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE)
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE)
+       ||  avctx->skip_frame >= AVDISCARD_ALL)
+        return buf_size;
+    /* skip everything if we are in a hurry>=5 */
+    if(avctx->hurry_up>=5)
+        return buf_size;
 
     for(i=0; i<slice_count; i++){
         int offset= get_slice_offset(avctx, slices_hdr, i);