changeset 5192:3bfa0f33c854 libavcodec

use the right stride patch by Vitor: [vitor1001 gmail com]
author benoit
date Wed, 27 Jun 2007 10:40:29 +0000
parents 4870b71fe348
children 19ed7e6ef927
files roqvideo.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/roqvideo.c	Wed Jun 27 06:57:31 2007 +0000
+++ b/roqvideo.c	Wed Jun 27 10:40:29 2007 +0000
@@ -52,6 +52,7 @@
     bptr[stride  ] = cell->y[2];
     bptr[stride+1] = cell->y[3];
 
+    stride = ri->c_stride;
     bptr = ri->current_frame->data[1] + boffs;
     bptr[0       ] =
     bptr[1       ] =
@@ -79,6 +80,7 @@
     bptr[stride*2  ] = bptr[stride*2+1] = bptr[stride*3  ] = bptr[stride*3+1] = cell->y[2];
     bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3];
 
+    stride = ri->c_stride;
     bptr = ri->current_frame->data[1] + boffs;
     bptr[         0] = bptr[         1] = bptr[stride    ] = bptr[stride  +1] =
     bptr[         2] = bptr[         3] = bptr[stride  +2] = bptr[stride  +3] =
@@ -109,10 +111,13 @@
         return;
     }
 
-    for(cp = 0; cp < 3; cp++)
-        block_copy(ri->current_frame->data[cp] + (y * ri->y_stride) + x,
-                   ri->last_frame->data[cp] + (my * ri->y_stride) + mx,
-                   ri->y_stride, ri->y_stride, sz);
+    for(cp = 0; cp < 3; cp++) {
+        int stride = ri->current_frame->linesize[cp];
+        block_copy(ri->current_frame->data[cp] + (y*stride) + x,
+                   ri->last_frame->data[cp] + (my*stride) + mx,
+                   stride, stride, sz);
+    }
+
 }