[vlc-commits] videotoolbox: use vlc_align helper

Marvin Scholz git at videolan.org
Tue Mar 24 19:20:34 CET 2020


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Mar 24 13:33:58 2020 +0100| [840a2c4daca900e9840a1ed72cf3da542ed8fe23] | committer: Marvin Scholz

videotoolbox: use vlc_align helper

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

 modules/codec/videotoolbox.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index 274e95e92c..4a0912cb08 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -48,7 +48,7 @@
 #import <sys/sysctl.h>
 #import <mach/machine.h>
 
-#define ALIGN_16( x ) ( ( ( x ) + 15 ) / 16 * 16 )
+#define VT_ALIGNMENT 16
 #define VT_RESTART_MAX 1
 
 #pragma mark - module descriptor
@@ -490,9 +490,9 @@ static bool ConfigureVoutH264(decoder_t *p_dec)
                                                 &i_vis_width, &i_vis_height))
         {
             p_dec->fmt_out.video.i_visible_width = i_vis_width;
-            p_dec->fmt_out.video.i_width = ALIGN_16( i_vis_width );
+            p_dec->fmt_out.video.i_width = vlc_align( i_vis_width, VT_ALIGNMENT );
             p_dec->fmt_out.video.i_visible_height = i_vis_height;
-            p_dec->fmt_out.video.i_height = ALIGN_16( i_vis_height );
+            p_dec->fmt_out.video.i_height = vlc_align( i_vis_height, VT_ALIGNMENT );
         }
         else return false;
     }
@@ -1618,8 +1618,8 @@ static int ConfigureVout(decoder_t *p_dec)
         p_dec->fmt_out.video.i_visible_height = p_dec->fmt_out.video.i_height;
     }
 
-    p_dec->fmt_out.video.i_width = ALIGN_16( p_dec->fmt_out.video.i_visible_width );
-    p_dec->fmt_out.video.i_height = ALIGN_16( p_dec->fmt_out.video.i_visible_height );
+    p_dec->fmt_out.video.i_width = vlc_align( p_dec->fmt_out.video.i_visible_width, VT_ALIGNMENT );
+    p_dec->fmt_out.video.i_height = vlc_align( p_dec->fmt_out.video.i_visible_height, VT_ALIGNMENT );
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list