summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-11-13 22:35:49 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-11-13 22:35:49 +0100
commit7071924cf2308c04a4ae53dd4a2c2070bf031a56 (patch)
tree25774b7f37ca59234eedc39e2c2ef34e7dd043aa /libavutil/hwcontext.c
parent72c38dd66e528f4d70c103c5cfc4ebc25a21cc62 (diff)
parentfdfe01365d579189d9a55b3741dba2ac46eb1df8 (diff)
Merge commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8'
* commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8': hwcontext: allocate the destination frame for the pool size Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index be1d73e82f..615f1f71da 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -321,6 +321,7 @@ int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ref,
static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
{
+ AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data;
AVFrame *frame_tmp;
int ret = 0;
@@ -343,8 +344,8 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
frame_tmp->format = formats[0];
av_freep(&formats);
}
- frame_tmp->width = src->width;
- frame_tmp->height = src->height;
+ frame_tmp->width = ctx->width;
+ frame_tmp->height = ctx->height;
ret = av_frame_get_buffer(frame_tmp, 32);
if (ret < 0)
@@ -354,6 +355,9 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
if (ret < 0)
goto fail;
+ frame_tmp->width = src->width;
+ frame_tmp->height = src->height;
+
av_frame_move_ref(dst, frame_tmp);
fail: