[vlc-devel] [PATCH] [RFC] video_output: reinit the vout is the display area of pictures have changed

Steve Lhomme robux4 at videolabs.io
Tue Dec 12 14:13:18 CET 2017

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
 src/video_output/video_output.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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

More information about the vlc-devel mailing list