OSDN Git Service

avcodec/nvenc: set frame buffer format for mapped frames
authorTimo Rothenpieler <timo@rothenpieler.org>
Fri, 10 Feb 2017 14:00:21 +0000 (15:00 +0100)
committerTimo Rothenpieler <timo@rothenpieler.org>
Mon, 13 Feb 2017 10:30:52 +0000 (11:30 +0100)
libavcodec/nvenc.c

index 7005465..51e794e 100644 (file)
@@ -1421,6 +1421,7 @@ static int nvenc_upload_frame(AVCodecContext *avctx, const AVFrame *frame,
         ctx->registered_frames[reg_idx].mapped = 1;
         nvenc_frame->reg_idx                   = reg_idx;
         nvenc_frame->input_surface             = nvenc_frame->in_map.mappedResource;
+        nvenc_frame->format                    = nvenc_frame->in_map.mappedBufferFmt;
         nvenc_frame->pitch                     = frame->linesize[0];
         return 0;
     } else {