[vlc-commits] [Git][videolan/vlc][master] video_epg: avoid video format copy

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 18 10:23:36 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c828db69 by Steve Lhomme at 2023-11-18T09:11:36+00:00
video_epg: avoid video format copy

The video_format_t is not used as is. It's only used to pass variables to
vout_BuildOSDEpg().

The i_width was never used.

The i_original_picture_width is set the same way as in OSDTextUpdate().

- - - - -


1 changed file:

- src/video_output/video_epg.c


Changes:

=====================================
src/video_output/video_epg.c
=====================================
@@ -508,19 +508,16 @@ static void OSDEpgUpdate(subpicture_t *subpic,
 
     vlc_spu_regions_Clear( &subpic->regions );
 
-    video_format_t fmt = *fmt_dst;
-    fmt.i_width         = fmt.i_width         * fmt.i_sar_num / fmt.i_sar_den;
-    fmt.i_visible_width = fmt.i_visible_width * fmt.i_sar_num / fmt.i_sar_den;
-    fmt.i_x_offset      = fmt.i_x_offset      * fmt.i_sar_num / fmt.i_sar_den;
+    unsigned i_x_offset = fmt_dst->i_x_offset * fmt_dst->i_sar_num / fmt_dst->i_sar_den;
 
-    subpic->i_original_picture_width  = fmt.i_visible_width;
-    subpic->i_original_picture_height = fmt.i_visible_height;
+    subpic->i_original_picture_width  = fmt_dst->i_visible_width * fmt_dst->i_sar_num / fmt_dst->i_sar_den;
+    subpic->i_original_picture_height = fmt_dst->i_visible_height;
 
     vout_BuildOSDEpg(sys, &subpic->regions,
-                                        fmt.i_x_offset,
-                                        fmt.i_y_offset,
-                                        fmt.i_visible_width,
-                                        fmt.i_visible_height);
+                                        i_x_offset,
+                                        fmt_dst->i_y_offset,
+                                        subpic->i_original_picture_width,
+                                        subpic->i_original_picture_height);
 }
 
 static void OSDEpgDestroy(subpicture_t *subpic)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c828db69e7230c076ea215ee2f19fda7700250c5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c828db69e7230c076ea215ee2f19fda7700250c5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list