lavfi/qsvvpp: provide a default framerate if needed

VPP in the SDK requires the frame rate to be set to a valid value,
otherwise init will fail, so always set a default framerate when the
input link doesn't have a valid framerate.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
Haihao Xiang 2022-11-28 12:43:20 +08:00
parent 51bad2e6a7
commit 7a856588dc
1 changed files with 8 additions and 0 deletions

View File

@ -324,6 +324,14 @@ static int fill_frameinfo_by_link(mfxFrameInfo *frameinfo, AVFilterLink *link)
frameinfo->CropH = link->h; frameinfo->CropH = link->h;
frameinfo->FrameRateExtN = link->frame_rate.num; frameinfo->FrameRateExtN = link->frame_rate.num;
frameinfo->FrameRateExtD = link->frame_rate.den; frameinfo->FrameRateExtD = link->frame_rate.den;
/* Apparently VPP in the SDK requires the frame rate to be set to some value, otherwise
* init will fail */
if (frameinfo->FrameRateExtD == 0 || frameinfo->FrameRateExtN == 0) {
frameinfo->FrameRateExtN = 25;
frameinfo->FrameRateExtD = 1;
}
frameinfo->AspectRatioW = link->sample_aspect_ratio.num ? link->sample_aspect_ratio.num : 1; frameinfo->AspectRatioW = link->sample_aspect_ratio.num ? link->sample_aspect_ratio.num : 1;
frameinfo->AspectRatioH = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1; frameinfo->AspectRatioH = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1;