CSCD: must use reget_buffer.

Using release_buffer and get_buffer as currently might
not prefer the previous frame contents which the
decoder relies on.
This leads to horrible playback in players using direct
rendering like MPlayer.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
Reimar Döffinger 2012-05-08 19:20:39 +02:00
parent 1ebf6f941e
commit badb0c07d4
1 changed files with 1 additions and 3 deletions

View File

@ -72,12 +72,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return -1; return -1;
} }
if (c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 3; c->pic.reference = 3;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE | c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE |
FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if (avctx->get_buffer(avctx, &c->pic) < 0) { if (avctx->reget_buffer(avctx, &c->pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1; return -1;
} }