[FFmpeg-cvslog] Use av_frame_copy() to simplify code where appropriate.
Anton Khirnov
git at videolan.org
Mon Feb 24 10:57:58 CET 2014
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Feb 11 15:08:12 2014 +0100| [30517a9f056c8d01b3790871db4aee95d9c176e6] | committer: Anton Khirnov
Use av_frame_copy() to simplify code where appropriate.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30517a9f056c8d01b3790871db4aee95d9c176e6
---
libavcodec/libwebpenc.c | 4 +---
libavfilter/vf_copy.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c
index 74e73dc..b981f48 100644
--- a/libavcodec/libwebpenc.c
+++ b/libavcodec/libwebpenc.c
@@ -161,9 +161,7 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ret = av_frame_get_buffer(alt_frame, 32);
if (ret < 0)
goto end;
- av_image_copy(alt_frame->data, alt_frame->linesize,
- frame->data, frame->linesize,
- avctx->pix_fmt, frame->width, frame->height);
+ av_frame_copy(alt_frame, frame);
frame = alt_frame;
}
pic->use_argb = 0;
diff --git a/libavfilter/vf_copy.c b/libavfilter/vf_copy.c
index 55175a0..5e60f20 100644
--- a/libavfilter/vf_copy.c
+++ b/libavfilter/vf_copy.c
@@ -37,9 +37,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
- av_image_copy(out->data, out->linesize, in->data, in->linesize,
- in->format, in->width, in->height);
-
+ av_frame_copy(out, in);
av_frame_free(&in);
return ff_filter_frame(outlink, out);
}
More information about the ffmpeg-cvslog
mailing list