[vlc-devel] [PATCH 09/17] video_output: set filter.changed when an aspect-ratio/crop change is detected

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 20 15:44:59 CET 2020


And use sys->filter.changed to trigger ThreadChangeFilters() after we have a
decoded picture to use.

The picture_Hold is not because the core needs an extra hold but because the
filter call may release the picture the core wants to keep.
---
 src/video_output/video_output.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index e1b37988b92..e74aae0b928 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1116,7 +1116,7 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
                         vlc_video_context_Release(sys->filter.src_vctx);
                     sys->filter.src_vctx = pic_vctx ? vlc_video_context_Hold(pic_vctx) : NULL;
 
-                    ThreadChangeFilters(vout);
+                    sys->filter.changed = true;
                 }
             }
         }
@@ -1128,9 +1128,14 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
         if (sys->displayed.decoded)
             picture_Release(sys->displayed.decoded);
 
-        sys->displayed.decoded       = picture_Hold(decoded);
+        sys->displayed.decoded       = decoded;
         sys->displayed.is_interlaced = !decoded->b_progressive;
 
+
+        if (sys->filter.changed)
+            ThreadChangeFilters(vout);
+
+        picture_Hold(sys->displayed.decoded);
         picture = filter_chain_VideoFilter(sys->filter.chain_static, sys->displayed.decoded);
     }
 
-- 
2.26.2



More information about the vlc-devel mailing list