diff options
author | Roberto Togni <r_togni@tiscali.it> | 2003-11-07 21:21:36 +0000 |
---|---|---|
committer | Roberto Togni <r_togni@tiscali.it> | 2003-11-07 21:21:36 +0000 |
commit | e02c251e5ab001eeb010c862670de9b188008b5d (patch) | |
tree | 388d2594114d6da7b6f7e2681a30bcf931bc3b07 /libavcodec/msrle.c | |
parent | 074c4ca7fd77457f90ab2f4e772ffac8caf17f9c (diff) | |
download | ffmpeg-e02c251e5ab001eeb010c862670de9b188008b5d.tar.gz |
Set buffer hints, use cr where available
Originally committed as revision 2485 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r-- | libavcodec/msrle.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index ce5c4c0a2e..5422d9be2a 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -160,10 +160,19 @@ static int msrle_decode_frame(AVCodecContext *avctx, { MsrleContext *s = (MsrleContext *)avctx->priv_data; + /* no supplementary picture */ + if (buf_size == 0) + return 0; + s->buf = buf; s->size = buf_size; s->frame.reference = 1; + s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE; + if (avctx->cr_available) + s->frame.buffer_hints |= FF_BUFFER_HINTS_REUSABLE; + else + s->frame.buffer_hints |= FF_BUFFER_HINTS_READABLE; if (avctx->get_buffer(avctx, &s->frame)) { av_log(avctx, AV_LOG_ERROR, " MS RLE: get_buffer() failed\n"); return -1; @@ -185,6 +194,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, avctx->release_buffer(avctx, &s->prev_frame); /* shuffle frames */ + if (!avctx->cr_available) s->prev_frame = s->frame; *data_size = sizeof(AVFrame); @@ -214,5 +224,5 @@ AVCodec msrle_decoder = { NULL, msrle_decode_end, msrle_decode_frame, - CODEC_CAP_DR1, + CODEC_CAP_DR1 | CODEC_CAP_CR, }; |