Mercurial > libavcodec.hg
changeset 5088:8e206208db1f libavcodec
fix skipped blocks
fixes decoding of (http://samples.mplayerhq.hu/game-formats/idroq/bf2introseg.roq)
author | michael |
---|---|
date | Fri, 01 Jun 2007 21:17:05 +0000 |
parents | 6c7f4ece59ed |
children | bff60ecc02f9 |
files | roqvideo.h roqvideodec.c |
diffstat | 2 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/roqvideo.h Thu May 31 21:40:22 2007 +0000 +++ b/roqvideo.h Fri Jun 01 21:17:05 2007 +0000 @@ -38,7 +38,6 @@ AVFrame frames[2]; AVFrame *last_frame; AVFrame *current_frame; - int first_frame; int y_stride; int c_stride;
--- a/roqvideodec.c Thu May 31 21:40:22 2007 +0000 +++ b/roqvideodec.c Fri Jun 01 21:17:05 2007 +0000 @@ -92,7 +92,6 @@ switch(vqid) { case RoQ_ID_MOT: - ff_apply_motion_8x8(ri, xp, yp, 0, 0); break; case RoQ_ID_FCC: mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8)); @@ -122,7 +121,6 @@ vqflg_pos--; switch(vqid) { case RoQ_ID_MOT: - ff_apply_motion_4x4(ri, x, y, 0, 0); break; case RoQ_ID_FCC: mx = 8 - (buf[bpos] >> 4) - ((signed char) (chunk_arg >> 8)); @@ -167,7 +165,6 @@ RoqContext *s = avctx->priv_data; s->avctx = avctx; - s->first_frame = 1; s->last_frame = &s->frames[0]; s->current_frame = &s->frames[1]; avctx->pix_fmt = PIX_FMT_YUV420P; @@ -182,7 +179,7 @@ { 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"); return -1; } @@ -193,12 +190,6 @@ s->size = buf_size; 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); *(AVFrame*)data = *s->current_frame; @@ -215,6 +206,8 @@ /* release the last frame */ if (s->last_frame->data[0]) avctx->release_buffer(avctx, s->last_frame); + if (s->current_frame->data[0]) + avctx->release_buffer(avctx, s->current_frame); return 0; }