From 7fd3c09e0f6560b72e2340f100886352eb9fc15d Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 10 Jan 2009 02:45:07 +0000 Subject: [PATCH] Move vdpau_h264_set_reference_frames() call from vdpauvideo.c into h264.c. Originally committed as revision 16513 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 3 +++ libavcodec/vdpau_internal.h | 1 + libavcodec/vdpauvideo.c | 5 +---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a8bd0622a4..f5a8833fa0 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -7624,6 +7624,9 @@ static int decode_frame(AVCodecContext *avctx, s->current_picture_ptr->qscale_type= FF_QSCALE_TYPE_H264; s->current_picture_ptr->pict_type= s->pict_type; + if (ENABLE_H264_VDPAU_DECODER && avctx->codec_id == CODEC_ID_H264_VDPAU) + ff_vdpau_h264_set_reference_frames(h); + if(!s->dropable) { execute_ref_pic_marking(h, h->mmco, h->mmco_index); h->prev_poc_msb= h->poc_msb; diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h index 6af24959c8..a989d89d29 100644 --- a/libavcodec/vdpau_internal.h +++ b/libavcodec/vdpau_internal.h @@ -29,6 +29,7 @@ void ff_vdpau_h264_add_data_chunk(H264Context *h, const uint8_t *buf, int buf_size); +void ff_vdpau_h264_set_reference_frames(H264Context *h); void ff_vdpau_h264_picture_complete(H264Context *h); #endif /* AVCODEC_VDPAU_INTERNAL_H */ diff --git a/libavcodec/vdpauvideo.c b/libavcodec/vdpauvideo.c index 8b42823486..c1405eb6da 100644 --- a/libavcodec/vdpauvideo.c +++ b/libavcodec/vdpauvideo.c @@ -37,7 +37,7 @@ * @{ */ -static void vdpau_h264_set_reference_frames(H264Context *h) +void ff_vdpau_h264_set_reference_frames(H264Context *h) { MpegEncContext * s = &h->s; struct vdpau_render_state * render, * render_ref; @@ -114,9 +114,6 @@ void ff_vdpau_h264_add_data_chunk(H264Context *h, const uint8_t *buf, int buf_si render = (struct vdpau_render_state*)s->current_picture_ptr->data[0]; assert(render); - if (!render->bitstream_buffers_used) - vdpau_h264_set_reference_frames(h); - render->bitstream_buffers= av_fast_realloc( render->bitstream_buffers, &render->bitstream_buffers_allocated,