[FFmpeg-devel] [PATCH] lavc/tscc: use reget_buffer.
Nicolas George
nicolas.george at normalesup.org
Fri Aug 17 16:47:32 CEST 2012
The previous code would release the buffer and get it
immediately after, assuming the contents is the same.
Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
libavcodec/tscc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Can someone confirm this is wrong:
ctx->release_buffer(&pic);
ctx->get_buffer(&pic);
/* assume that pic still contains the previous data */
?
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index 5573d28..954e372 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -79,12 +79,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
int zret; // Zlib return code
int ret, len = buf_size;
- if(c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
-
c->pic.reference = 3;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
- if((ret = avctx->get_buffer(avctx, &c->pic)) < 0){
+ if((ret = avctx->reget_buffer(avctx, &c->pic)) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
--
1.7.10.4
More information about the ffmpeg-devel
mailing list