aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/qsvvpp.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2022-11-28 12:43:20 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-12-01 09:40:31 +0800
commit7a856588dc591854892f69c2d1429473a3ed3f5b (patch)
treee3865fca91c906a071590d2d2f0034289a50c23d /libavfilter/qsvvpp.c
parent51bad2e6a73f8edd09139107b6fc43b4ed200162 (diff)
downloadffmpeg-7a856588dc591854892f69c2d1429473a3ed3f5b.tar.gz
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>
Diffstat (limited to 'libavfilter/qsvvpp.c')
-rw-r--r--libavfilter/qsvvpp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index a088f6b61f..a588a37610 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -324,6 +324,14 @@ static int fill_frameinfo_by_link(mfxFrameInfo *frameinfo, AVFilterLink *link)
frameinfo->CropH = link->h;
frameinfo->FrameRateExtN = link->frame_rate.num;
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->AspectRatioH = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1;