[vlc-devel] [PATCH 3/3] videotoolbox: Use vlc_align helper
Marvin Scholz
epirat07 at gmail.com
Wed Feb 12 14:50:14 CET 2020
---
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 edf39a88a2..a43a15146f 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;
}
@@ -1623,8 +1623,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;
}
--
2.24.1 (Apple Git-126)
More information about the vlc-devel
mailing list