mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 11:22:14 +00:00
lavc/qsvenc: use the right info for encoding
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
parent
cda721e01d
commit
75015f9b0e
@ -745,8 +745,9 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
|
||||
if (avctx->hw_frames_ctx) {
|
||||
AVHWFramesContext *frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data;
|
||||
AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
|
||||
q->param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width;
|
||||
q->param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height;
|
||||
mfxFrameInfo *info = frames_hwctx->nb_surfaces ? &frames_hwctx->surfaces[0].Info : frames_hwctx->info;
|
||||
q->param.mfx.FrameInfo.Width = info->Width;
|
||||
q->param.mfx.FrameInfo.Height = info->Height;
|
||||
}
|
||||
|
||||
if (avctx->framerate.den > 0 && avctx->framerate.num > 0) {
|
||||
@ -869,8 +870,9 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
|
||||
if (avctx->hw_frames_ctx) {
|
||||
AVHWFramesContext *frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
|
||||
AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
|
||||
q->param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width;
|
||||
q->param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height;
|
||||
mfxFrameInfo *info = frames_hwctx->nb_surfaces ? &frames_hwctx->surfaces[0].Info : frames_hwctx->info;
|
||||
q->param.mfx.FrameInfo.Width = info->Width;
|
||||
q->param.mfx.FrameInfo.Height = info->Height;
|
||||
}
|
||||
|
||||
if (avctx->framerate.den > 0 && avctx->framerate.num > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user