summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-20 11:57:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-20 11:57:28 +0100
commitf7fee8f700c27273fd0398d89c00ff7725bbf3fa (patch)
treeb8fdf15bb84dbbf094b91a82f3a0255aaa99caec /libavcodec/h264.c
parent084510d12ab6af7ecb516b6fbc03c99c3617d5ce (diff)
parentc3ebfcd6e1327ca7bbcaee822e593c2da6cfd352 (diff)
Merge commit 'c3ebfcd6e1327ca7bbcaee822e593c2da6cfd352'
* commit 'c3ebfcd6e1327ca7bbcaee822e593c2da6cfd352': mpegvideo: allocate hwaccel privdata after the frame buffer h264: allocate hwaccel privdata after the frame buffer Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index e8140c9450..2f5839050a 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -343,6 +343,15 @@ static int alloc_picture(H264Context *h, Picture *pic)
av_assert0(!pic->f.data[0]);
+ pic->tf.f = &pic->f;
+ ret = ff_thread_get_buffer(h->avctx, &pic->tf, pic->reference ?
+ AV_GET_BUFFER_FLAG_REF : 0);
+ if (ret < 0)
+ goto fail;
+
+ h->linesize = pic->f.linesize[0];
+ h->uvlinesize = pic->f.linesize[1];
+
if (h->avctx->hwaccel) {
const AVHWAccel *hwaccel = h->avctx->hwaccel;
av_assert0(!pic->hwaccel_picture_private);
@@ -353,14 +362,6 @@ static int alloc_picture(H264Context *h, Picture *pic)
pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data;
}
}
- pic->tf.f = &pic->f;
- ret = ff_thread_get_buffer(h->avctx, &pic->tf, pic->reference ?
- AV_GET_BUFFER_FLAG_REF : 0);
- if (ret < 0)
- goto fail;
-
- h->linesize = pic->f.linesize[0];
- h->uvlinesize = pic->f.linesize[1];
if (!h->qscale_table_pool) {
ret = init_table_pools(h);