summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau_h264.c
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-10-04 16:55:03 +0300
committerAnton Khirnov <anton@khirnov.net>2014-10-05 10:13:44 +0000
commitfcc1022611f79c2f3aa2f392a5ce14c74be9c1d7 (patch)
treeac464a1ca7ecd6699e49528132a442ac69d2fd88 /libavcodec/vdpau_h264.c
parent319424d25c53f82b87187ce03ed984d438f1bee6 (diff)
vdpau: factor out common end-of-frame handling
Also add error handling. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vdpau_h264.c')
-rw-r--r--libavcodec/vdpau_h264.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 32e9c28706..838a6700ff 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -189,18 +189,16 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx,
static int vdpau_h264_end_frame(AVCodecContext *avctx)
{
- AVVDPAUContext *hwctx = avctx->hwaccel_context;
H264Context *h = avctx->priv_data;
H264Picture *pic = h->cur_pic_ptr;
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
- VdpVideoSurface surf = ff_vdpau_get_surface_id(&pic->f);
+ int val;
- hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
- pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
+ val = ff_vdpau_common_end_frame(avctx, &pic->f, pic_ctx);
+ if (val < 0)
+ return val;
ff_h264_draw_horiz_band(h, 0, h->avctx->height);
- av_freep(&pic_ctx->bitstream_buffers);
-
return 0;
}