diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-24 03:25:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-24 03:25:47 +0100 |
commit | 9b68538fddf6eaea119d907afdbfdb3b88ce5137 (patch) | |
tree | e29d87c53006018c62230033d081a313a94f8062 | |
parent | a26e9c1040afeecf9013da742b0dec7009445f2b (diff) | |
download | ffmpeg-9b68538fddf6eaea119d907afdbfdb3b88ce5137.tar.gz |
avcodec/libopenjpegenc: Replace av_frame_alloc() and av_frame_ref() by av_frame_clone()
Simplifies code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/libopenjpegenc.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index f113be38f9..083da64259 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -501,13 +501,9 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_GBRP12: case AV_PIX_FMT_GBRP14: case AV_PIX_FMT_GBRP16: - gbrframe = av_frame_alloc(); + gbrframe = av_frame_clone(frame); if (!gbrframe) return AVERROR(ENOMEM); - if ((ret = av_frame_ref(gbrframe, frame)) < 0) { - av_frame_free(&gbrframe); - return ret; - } gbrframe->data[0] = frame->data[2]; // swap to be rgb gbrframe->data[1] = frame->data[0]; gbrframe->data[2] = frame->data[1]; |