[SCM] libav/experimental: add width and height in context and use them patch by Vitor: [vitor1001 gmail com]

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:02:49 UTC 2013


The following commit has been merged in the experimental branch:
commit 9489d2ef3f61fecd1aa8f31cd816d9c6d766bf23
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Tue Jun 26 20:10:26 2007 +0000

    add width and height in context and use them
    patch by Vitor: [vitor1001 gmail com]
    
    Originally committed as revision 9438 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/roqvideo.c b/libavcodec/roqvideo.c
index e478d4c..d53d090 100644
--- a/libavcodec/roqvideo.c
+++ b/libavcodec/roqvideo.c
@@ -102,10 +102,10 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax
     my = y + deltay;
 
     /* check MV against frame boundaries */
-    if ((mx < 0) || (mx > ri->avctx->width - sz) ||
-        (my < 0) || (my > ri->avctx->height - sz)) {
+    if ((mx < 0) || (mx > ri->width - sz) ||
+        (my < 0) || (my > ri->height - sz)) {
         av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
-            mx, my, ri->avctx->width, ri->avctx->height);
+            mx, my, ri->width, ri->height);
         return;
     }
 
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 2836912..8a3328e 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -145,11 +145,11 @@ static void roqvideo_decode_frame(RoqContext *ri)
         }
 
         xpos += 16;
-        if (xpos >= ri->avctx->width) {
-            xpos -= ri->avctx->width;
+        if (xpos >= ri->width) {
+            xpos -= ri->width;
             ypos += 16;
         }
-        if(ypos >= ri->avctx->height)
+        if(ypos >= ri->height)
             break;
     }
 }
@@ -160,6 +160,8 @@ static int roq_decode_init(AVCodecContext *avctx)
     RoqContext *s = avctx->priv_data;
 
     s->avctx = avctx;
+    s->width = avctx->width;
+    s->height = avctx->height;
     s->last_frame    = &s->frames[0];
     s->current_frame = &s->frames[1];
     avctx->pix_fmt = PIX_FMT_YUV444P;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list