[vlc-devel] [PATCH] video_filter/scale: remove outdated warning

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 25 14:25:33 CEST 2020


Video filters can change the output format including the aspect ratio, as long
as b_allow_fmt_out_change is set.

No need to set the AR again once it's set on open, the fmt_out won't change.
---
 modules/video_filter/scale.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/video_filter/scale.c b/modules/video_filter/scale.c
index ef5189e2e13..072bab2d9dd 100644
--- a/modules/video_filter/scale.c
+++ b/modules/video_filter/scale.c
@@ -56,6 +56,12 @@ static int OpenFilter( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t*)p_this;
 
+    if( !p_filter->b_allow_fmt_out_change )
+    {
+        msg_Err( p_filter, "Picture format change isn't allowed" );
+        return VLC_EGENERIC;
+    }
+
     if( ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVP &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA &&
           p_filter->fmt_in.video.i_chroma != VLC_CODEC_I420 &&
@@ -72,7 +78,6 @@ static int OpenFilter( vlc_object_t *p_this )
     if( p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
         return VLC_EGENERIC;
 
-#warning Converter cannot (really) change output format.
     video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
     p_filter->pf_video_filter = Filter;
 
@@ -92,9 +97,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     if( !p_pic ) return NULL;
 
-#warning Converter cannot (really) change output format.
-    video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
-
     /* Request output picture */
     p_pic_dst = filter_NewPicture( p_filter );
     if( !p_pic_dst )
-- 
2.26.2



More information about the vlc-devel mailing list