[vlc-commits] video_output: reinit the vout if the crop changes

Steve Lhomme git at videolan.org
Mon Dec 18 13:18:57 CET 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Tue Dec 12 14:13:18 2017 +0100| [17efaa77b82e61f224b0723b6309c01b6dc687c1] | committer: Thomas Guillem

video_output: reinit the vout if the crop changes

If you play a file that has the same decoder size but different display size
consecutively, the decoder picture pool needs to be updated so that the
i_visible_lines of each picture plane matches the new picture format.

The easiest way is to reinit the vout. Another way would be to update the
pictures in each picture pool dynamically. It cannot just be handled on the
vout side as some decoders and filters rely on i_visible/offset to copy
only the required data (for example lavc_CopyPicture).

Fixes #19268

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

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

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0088ee9cca..640d999e80 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1545,8 +1545,12 @@ static int ThreadReinit(vout_thread_t *vout,
         ThreadClean(vout);
         return VLC_EGENERIC;
     }
-    /* We ignore crop/ar changes at this point, they are dynamically supported */
-    VideoFormatCopyCropAr(&vout->p->original, &original);
+
+    /* 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;
     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