History

libavcodec/qsvdec: use the parameter from decodeHeader to configure surface

MSDK recognizes both yuv420p10 and yuv420p9 as MFX_FOURCC_P010, but parameters are different. When decode yuv420p9 video, ffmpeg-qsv will use yuv420p10le to configure surface which is different with param from DecoderHeader and this will lead to error. Now change it use param from decoderHeader to configure surface.

Wenbin Chen committed 4 years ago

Commit b1c26ce1 parent 9e2deba1 file · +2 −2Browse files

Unified · Split

libavcodec/qsvdec.c+2−2
@@ -423,13 +423,13 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame) · 422 unmodified lines
423423 if (frame->frame->format == AV_PIX_FMT_QSV) {
424424 frame->surface = *(mfxFrameSurface1*)frame->frame->data[3];
425425 } else {
426− frame->surface.Info = q->frame_info;
427−
428426 frame->surface.Data.PitchLow = frame->frame->linesize[0];
429427 frame->surface.Data.Y = frame->frame->data[0];
430428 frame->surface.Data.UV = frame->frame->data[1];
431429 }
432430
431+ frame->surface.Info = q->frame_info;
432+
433433 if (q->frames_ctx.mids) {
434434 ret = ff_qsv_find_surface_idx(&q->frames_ctx, frame);
435435 if (ret < 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t