Commit 5f93f90b authored by michael's avatar michael

fix skiped blocks

fixes decoding of (http://icculus.org/~riot/bf2introseg.bz2)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9168 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0cae6d85
...@@ -38,7 +38,6 @@ typedef struct RoqContext { ...@@ -38,7 +38,6 @@ typedef struct RoqContext {
AVFrame frames[2]; AVFrame frames[2];
AVFrame *last_frame; AVFrame *last_frame;
AVFrame *current_frame; AVFrame *current_frame;
int first_frame;
int y_stride; int y_stride;
int c_stride; int c_stride;
......
...@@ -92,7 +92,6 @@ static void roqvideo_decode_frame(RoqContext *ri) ...@@ -92,7 +92,6 @@ static void roqvideo_decode_frame(RoqContext *ri)
switch(vqid) { switch(vqid) {
case RoQ_ID_MOT: case RoQ_ID_MOT:
ff_apply_motion_8x8(ri, xp, yp, 0, 0);
break; break;
case RoQ_ID_FCC: case RoQ_ID_FCC:
mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8)); mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8));
...@@ -122,7 +121,6 @@ static void roqvideo_decode_frame(RoqContext *ri) ...@@ -122,7 +121,6 @@ static void roqvideo_decode_frame(RoqContext *ri)
vqflg_pos--; vqflg_pos--;
switch(vqid) { switch(vqid) {
case RoQ_ID_MOT: case RoQ_ID_MOT:
ff_apply_motion_4x4(ri, x, y, 0, 0);
break; break;
case RoQ_ID_FCC: case RoQ_ID_FCC:
mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8)); mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8));
...@@ -167,7 +165,6 @@ static int roq_decode_init(AVCodecContext *avctx) ...@@ -167,7 +165,6 @@ static int roq_decode_init(AVCodecContext *avctx)
RoqContext *s = avctx->priv_data; RoqContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
s->first_frame = 1;
s->last_frame = &s->frames[0]; s->last_frame = &s->frames[0];
s->current_frame = &s->frames[1]; s->current_frame = &s->frames[1];
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = PIX_FMT_YUV420P;
...@@ -182,7 +179,7 @@ static int roq_decode_frame(AVCodecContext *avctx, ...@@ -182,7 +179,7 @@ static int roq_decode_frame(AVCodecContext *avctx,
{ {
RoqContext *s = avctx->priv_data; RoqContext *s = avctx->priv_data;
if (avctx->get_buffer(avctx, s->current_frame)) { if (avctx->reget_buffer(avctx, s->current_frame)) {
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1; return -1;
} }
...@@ -193,12 +190,6 @@ static int roq_decode_frame(AVCodecContext *avctx, ...@@ -193,12 +190,6 @@ static int roq_decode_frame(AVCodecContext *avctx,
s->size = buf_size; s->size = buf_size;
roqvideo_decode_frame(s); roqvideo_decode_frame(s);
/* release the last frame if it is allocated */
if (s->first_frame)
s->first_frame = 0;
else
avctx->release_buffer(avctx, s->last_frame);
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
*(AVFrame*)data = *s->current_frame; *(AVFrame*)data = *s->current_frame;
...@@ -215,6 +206,8 @@ static int roq_decode_end(AVCodecContext *avctx) ...@@ -215,6 +206,8 @@ static int roq_decode_end(AVCodecContext *avctx)
/* release the last frame */ /* release the last frame */
if (s->last_frame->data[0]) if (s->last_frame->data[0])
avctx->release_buffer(avctx, s->last_frame); avctx->release_buffer(avctx, s->last_frame);
if (s->current_frame->data[0])
avctx->release_buffer(avctx, s->current_frame);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment