[FFmpeg-cvslog] r19875 - trunk/libavcodec/mpeg12.c

gb subversion
Wed Sep 16 09:49:08 CEST 2009


Author: gb
Date: Wed Sep 16 09:49:08 2009
New Revision: 19875

Log:
Move down HWAccel code path so that to fill in s->mb_x first.

Modified:
   trunk/libavcodec/mpeg12.c

Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c	Wed Sep 16 06:43:33 2009	(r19874)
+++ trunk/libavcodec/mpeg12.c	Wed Sep 16 09:49:08 2009	(r19875)
@@ -1714,19 +1714,6 @@ static int mpeg_decode_slice(Mpeg1Contex
 
     s->mb_x=0;
 
-    if (avctx->hwaccel) {
-        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
-        int start_code = -1;
-        buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
-        if (buf_end < *buf + buf_size)
-            buf_end -= 4;
-        s->mb_y = mb_y;
-        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
-            return DECODE_SLICE_ERROR;
-        *buf = buf_end;
-        return DECODE_SLICE_OK;
-    }
-
     for(;;) {
         int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
         if (code < 0){
@@ -1748,6 +1735,19 @@ static int mpeg_decode_slice(Mpeg1Contex
         return -1;
     }
 
+    if (avctx->hwaccel) {
+        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
+        int start_code = -1;
+        buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
+        if (buf_end < *buf + buf_size)
+            buf_end -= 4;
+        s->mb_y = mb_y;
+        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
+            return DECODE_SLICE_ERROR;
+        *buf = buf_end;
+        return DECODE_SLICE_OK;
+    }
+
     s->resync_mb_x= s->mb_x;
     s->resync_mb_y= s->mb_y= mb_y;
     s->mb_skip_run= 0;



More information about the ffmpeg-cvslog mailing list