[vlc-commits] tospdif: use vlc_align helper

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


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Mar 24 13:37:23 2020 +0100| [656d6b80c048f7c64e6666d0d2b11dcfe38d0434] | committer: Marvin Scholz

tospdif: use vlc_align helper

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

 modules/audio_filter/converter/tospdif.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index 239deae26f..1029e911a8 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -519,9 +519,8 @@ static int write_buffer_dtshd( filter_t *p_filter, block_t *p_in_buf )
 
     /* Align so that (length_code & 0xf) == 0x8. This is reportedly needed
      * with some receivers, but the exact requirement is unconfirmed. */
-#define ALIGN(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
-    size_t i_align = ALIGN( i_in_size + 0x8, 0x10 ) - 0x8;
-#undef ALIGN
+    size_t i_align = vlc_align( i_in_size + 0x8, 0x10 ) - 0x8;
+
     if( i_align > i_in_size && i_align - i_in_size
         <= p_sys->p_out_buf->i_buffer - p_sys->i_out_offset )
         write_padding( p_filter, i_align - i_in_size );



More information about the vlc-commits mailing list