summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2009-09-16 07:49:08 +0000
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>2009-09-16 07:49:08 +0000
commit25450bb252de89469278e3dd11252c8424b3ad63 (patch)
tree55a1684fcd0e6db7218d08e5ae54950354c33a29 /libavcodec/mpeg12.c
parent9117213313f589627c3760bc66412c337ee2179d (diff)
downloadffmpeg-25450bb252de89469278e3dd11252c8424b3ad63.tar.gz
Move down HWAccel code path so that to fill in s->mb_x first.
Originally committed as revision 19875 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 477e99c444..add6a58a0a 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1714,19 +1714,6 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
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(Mpeg1Context *s1, int mb_y,
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;