[FFmpeg-devel] [PATCH] ffplay: avoid unnecessary intermediary struct in queue_picture()

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Apr 11 11:13:38 CEST 2011


When CONFIG_AVFILTER, use a AVFrame -> AVPicture cast rather than
explicitely copy the image information from AVFrame to a new
AVPicture.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
---
 ffplay.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index 201200d..8ab05a9 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1363,9 +1363,6 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
 {
     VideoPicture *vp;
     int dst_pix_fmt;
-#if CONFIG_AVFILTER
-    AVPicture pict_src;
-#endif
     /* wait until we have space to put a new picture */
     SDL_LockMutex(is->pictq_mutex);
 
@@ -1436,16 +1433,8 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
         pict.linesize[2] = vp->bmp->pitches[1];
 
 #if CONFIG_AVFILTER
-        pict_src.data[0] = src_frame->data[0];
-        pict_src.data[1] = src_frame->data[1];
-        pict_src.data[2] = src_frame->data[2];
-
-        pict_src.linesize[0] = src_frame->linesize[0];
-        pict_src.linesize[1] = src_frame->linesize[1];
-        pict_src.linesize[2] = src_frame->linesize[2];
-
         //FIXME use direct rendering
-        av_picture_copy(&pict, &pict_src,
+        av_picture_copy(&pict, (AVPicture *)src_frame,
                         vp->pix_fmt, vp->width, vp->height);
 #else
         sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
-- 
1.7.2.3



More information about the ffmpeg-devel mailing list