comparison roqvideodec.c @ 5524:f47bc5359101 libavcodec

fix decoding of samples.mplayerhq.hu/game-formats/idroq/demoEnd.roq closes issue78
author michael
date Sat, 11 Aug 2007 23:09:28 +0000
parents 2b72f9bc4f06
children dfdff1ca78a7
comparison
equal deleted inserted replaced
5523:c2ab2ac31edb 5524:f47bc5359101
172 static int roq_decode_frame(AVCodecContext *avctx, 172 static int roq_decode_frame(AVCodecContext *avctx,
173 void *data, int *data_size, 173 void *data, int *data_size,
174 uint8_t *buf, int buf_size) 174 uint8_t *buf, int buf_size)
175 { 175 {
176 RoqContext *s = avctx->priv_data; 176 RoqContext *s = avctx->priv_data;
177 int copy= !s->current_frame->data[0];
177 178
178 if (avctx->reget_buffer(avctx, s->current_frame)) { 179 if (avctx->reget_buffer(avctx, s->current_frame)) {
179 av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n"); 180 av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
180 return -1; 181 return -1;
181 } 182 }
183
184 if(copy)
185 av_picture_copy((AVPicture*)s->current_frame, (AVPicture*)s->last_frame,
186 avctx->pix_fmt, avctx->width, avctx->height);
182 187
183 s->buf = buf; 188 s->buf = buf;
184 s->size = buf_size; 189 s->size = buf_size;
185 roqvideo_decode_frame(s); 190 roqvideo_decode_frame(s);
186 191