]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv10.c
Merge commit 'b5f9b9ac3681acb06d95530f34660ba9fe225305'
[ffmpeg] / libavcodec / rv10.c
index db39f4627bf4abee87412fdf5e77bb259f2ac000..2334fd1f1261bd5470e057b094d1acbc4f76890a 100644 (file)
@@ -415,13 +415,15 @@ static int rv20_decode_picture_header(RVDecContext *rv)
         }else{
             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, possible from seeking? skipping current b frame\n");
-                return FRAME_SKIPPED;
-            }
-            ff_mpeg4_init_direct_mv(s);
         }
     }
+    if (s->pict_type==AV_PICTURE_TYPE_B) {
+        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, possible from seeking? skipping current b frame\n");
+            return FRAME_SKIPPED;
+        }
+        ff_mpeg4_init_direct_mv(s);
+    }
 
     s->no_rounding= get_bits1(&s->gb);
 
@@ -740,7 +742,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
             *got_frame = 1;
             ff_print_debug_info(s, pict);
         }
-        s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
+        s->current_picture_ptr= NULL; // so we can detect if frame_end was not called (find some nicer solution...)
     }
 
     return avpkt->size;