[vlc-devel] [PATCH 4/4] vmem: update visible width/height only if width/height was changed

Sergey Radionov rsatom at gmail.com
Sat Jan 30 09:27:38 CET 2016


this allow avoid software frame resize
---
 modules/video_output/vmem.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 3122e5a..2fe54ea 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -211,10 +211,13 @@ static int Open(vlc_object_t *object)
         sys->cleanup = NULL;
     }
     fmt.i_x_offset = fmt.i_y_offset = 0;
-    fmt.i_width = widths[0];
-    fmt.i_height = heights[0];
-    fmt.i_visible_width = fmt.i_width;
-    fmt.i_visible_height = fmt.i_height;
+
+    if (widths[0] != fmt.i_width || heights[0] != fmt.i_height) {
+        fmt.i_width = widths[0];
+        fmt.i_height = heights[0];
+        fmt.i_visible_width = fmt.i_width;
+        fmt.i_visible_height = fmt.i_height;
+    }
 
     if (!fmt.i_chroma) {
         msg_Err(vd, "vmem-chroma should be 4 characters long");
-- 
2.6.3.windows.1



More information about the vlc-devel mailing list