changeset 308:072c4ff05e62 libavcodec

b frames & slices bugfix
author michaelni
date Fri, 05 Apr 2002 04:23:01 +0000
parents 764aeec1320e
children 32485ad4cc4e
files h263dec.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h263dec.c	Fri Apr 05 04:09:04 2002 +0000
+++ b/h263dec.c	Fri Apr 05 04:23:01 2002 +0000
@@ -220,9 +220,15 @@
             if (h > 16)
                 h = 16;
             offset = y * s->linesize;
-            src_ptr[0] = s->current_picture[0] + offset;
-            src_ptr[1] = s->current_picture[1] + (offset >> 2);
-            src_ptr[2] = s->current_picture[2] + (offset >> 2);
+            if(s->pict_type==B_TYPE || (!s->has_b_frames)){
+                src_ptr[0] = s->current_picture[0] + offset;
+                src_ptr[1] = s->current_picture[1] + (offset >> 2);
+                src_ptr[2] = s->current_picture[2] + (offset >> 2);
+            } else {
+                src_ptr[0] = s->last_picture[0] + offset;
+                src_ptr[1] = s->last_picture[1] + (offset >> 2);
+                src_ptr[2] = s->last_picture[2] + (offset >> 2);
+            }
             avctx->draw_horiz_band(avctx, src_ptr, s->linesize,
                                    y, s->width, h);
         }