[vlc-commits] vout: recreate the display also on mismatched SAR

Rémi Denis-Courmont git at videolan.org
Sat Jan 26 19:51:27 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jan 26 16:37:21 2019 +0200| [ff3457d8299365bff0c4ca967c5ff54c58adcb25] | committer: Rémi Denis-Courmont

vout: recreate the display also on mismatched SAR

Since 4.0.0-dev-395-g17efaa77b8, the display is recreated if source
format crop parameters do not match. The same problem and same solution
apply if the source format sample aspect ratio changes.

Incidentally, this fixes a data race on vout->p->original, which may be
read from another thread.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff3457d8299365bff0c4ca967c5ff54c58adcb25
---

 src/video_output/video_output.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 327cb63c66..ee3f69bbb5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1738,11 +1738,9 @@ static int ThreadReinit(vout_thread_t *vout,
 
     VoutFixFormat(&original, cfg->fmt);
 
-    /* We ignore ar changes at this point, they are dynamically supported.
-     * #19268: don't ignore crop changes (fix vouts using the crop size of the
-     * previous format). */
-    vout->p->original.i_sar_num = original.i_sar_num;
-    vout->p->original.i_sar_den = original.i_sar_den;
+    /* TODO: If dimensions are equal or slightly smaller, update the aspect
+     * ratio and crop settings, instead of recreating a display.
+     */
     if (video_format_IsSimilar(&original, &vout->p->original)) {
         if (cfg->dpb_size <= vout->p->dpb_size) {
             video_format_Clean(&original);



More information about the vlc-commits mailing list