[vlc-devel] [PATCH] vout: we cannot reuse the decoder pool when the crop changes

Steve Lhomme robux4 at videolabs.io
Thu Aug 18 12:40:41 CEST 2016


If the crop values expand the pictures of the decoder pool would not be
reallocated and keep an i_visible_lines that is not enough for the new crop
area. Many filters will not copy more than the visible lines, starting with
picture_Copy() used in ThreadDisplayRenderPicture().

Fixes #17602
---
 src/video_output/video_output.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 7994bec..06fd0be 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -94,12 +94,17 @@ static int VoutValidateFormat(video_format_t *dst,
     video_format_FixRgb(dst);
     return VLC_SUCCESS;
 }
+static void VideoFormatCopyAr(video_format_t *dst,
+                              const video_format_t *src)
+{
+    dst->i_sar_num = src->i_sar_num;
+    dst->i_sar_den = src->i_sar_den;
+}
 static void VideoFormatCopyCropAr(video_format_t *dst,
                                   const video_format_t *src)
 {
     video_format_CopyCrop(dst, src);
-    dst->i_sar_num = src->i_sar_num;
-    dst->i_sar_den = src->i_sar_den;
+    VideoFormatCopyAr(dst, src);
 }
 static bool VideoFormatIsCropArEqual(video_format_t *dst,
                                      const video_format_t *src)
@@ -1417,8 +1422,8 @@ 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 */
+    VideoFormatCopyAr(&vout->p->original, &original);
     if (video_format_IsSimilar(&original, &vout->p->original)) {
         if (cfg->dpb_size <= vout->p->dpb_size) {
             video_format_Clean(&original);
-- 
2.9.1



More information about the vlc-devel mailing list