X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fhwcontext.c;h=615f1f71da8a2bba0a86aca8bedf78234d3ff23d;hb=c3d822855cb5220e478d8b0ba0bafde18aa2f122;hp=be1d73e82f6a38256338e759d5028a3733ad3cfd;hpb=72c38dd66e528f4d70c103c5cfc4ebc25a21cc62;p=ffmpeg diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index be1d73e82f6..615f1f71da8 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: