diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-05-02 23:36:45 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-13 10:06:27 +0200 |
commit | a6f395d6c5dc2c3503444c7119bbff628c7b6887 (patch) | |
tree | fca7ee423b651b5c5095f206b1ab9e7c392e2312 | |
parent | c1d4bb5731189cb7851b2be1281359d976873eec (diff) | |
download | ffmpeg-a6f395d6c5dc2c3503444c7119bbff628c7b6887.tar.gz |
ffplay: avoid unnecessary intermediary struct in queue_picture()
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@poste.it>
-rw-r--r-- | ffplay.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -1357,9 +1357,7 @@ static void alloc_picture(void *opaque) static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t pos) { VideoPicture *vp; -#if CONFIG_AVFILTER - AVPicture pict_src; -#endif + /* wait until we have space to put a new picture */ SDL_LockMutex(is->pictq_mutex); @@ -1429,16 +1427,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); |