]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv10.c
Ministry of English Composition, reporting for duty (and the word is "skipped", not...
[ffmpeg] / libavcodec / rv10.c
index 4a6bf0f72e85e340c6dbad6e55576396b6320b3a..23106bcc0acab7c3afd67f3451416c996e69a209 100644 (file)
@@ -287,6 +287,7 @@ void rv20_encode_picture_header(MpegEncContext *s, int picture_number){
     }
 }
 
+#if 0 /* unused, remove? */
 static int get_num(GetBitContext *gb)
 {
     int n, n1;
@@ -299,6 +300,7 @@ static int get_num(GetBitContext *gb)
         return (n << 16) | n1;
     }
 }
+#endif
 
 #endif //CONFIG_ENCODERS
 
@@ -438,12 +440,12 @@ static int rv20_decode_picture_header(MpegEncContext *s)
         }
         seq= get_bits(&s->gb, 14)<<1;
 
-        if(v>1){
+        if(v>1 || (s->avctx->sub_id < 0x20201002 && v>0)){
             f= get_bits(&s->gb, av_log2(v-1)+1);
         }
         
         if(s->avctx->debug & FF_DEBUG_PICT_INFO){
-            av_log(s->avctx, AV_LOG_DEBUG, "F %d\n", f);
+            av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d\n", f, v);
         }
 
         mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1);
@@ -466,8 +468,8 @@ static int rv20_decode_picture_header(MpegEncContext *s)
             s->time= seq;
             s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
             if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){
-                av_log(s->avctx, AV_LOG_DEBUG, "messed up order, seeking?, skiping current b frame\n");
-                return FRAME_SKIPED;
+                av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible from seeking? skipping current b frame\n");
+                return FRAME_SKIPPED;
             }
         }
     }
@@ -541,6 +543,7 @@ static int rv10_decode_init(AVCodecContext *avctx)
         break;
     case 0x20200002:
     case 0x20201002:
+    case 0x20203002:
     case 0x30202002:
     case 0x30203002:
         s->low_delay=0;
@@ -763,7 +766,7 @@ AVCodec rv20_decoder = {
     NULL,
     rv10_decode_end,
     rv10_decode_frame,
-    CODEC_CAP_DR1,
+    CODEC_CAP_DR1 | CODEC_CAP_DELAY,
     .flush= ff_mpeg_flush,
 };