[vlc-devel] [PATCH 2/2] modules: fix use custom swab calls

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 12 15:53:19 CEST 2019


It expects an input 'char *' instead of 'const char *' even though it's not
writing on the source on win32.
---
 modules/audio_filter/converter/tospdif.c | 3 ++-
 modules/codec/araw.c                     | 3 ++-
 modules/demux/mpeg/es.c                  | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index 5b11cace29..f3ba00c6ea 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -31,6 +31,7 @@
 #include <assert.h>
 
 #include <vlc_common.h>
+#include <vlc_unistd.h>
 #include <vlc_plugin.h>
 
 #include <vlc_aout.h>
@@ -148,7 +149,7 @@ static void write_data( filter_t *p_filter, const void *p_buf, size_t i_size,
     assert( p_sys->p_out_buf->i_buffer - p_sys->i_out_offset >= i_size );
 
     if( b_input_big_endian != b_output_big_endian )
-        swab( p_in, p_out, i_size & ~1 );
+        vlc_swab( p_in, p_out, i_size & ~1 );
     else
         memcpy( p_out, p_in, i_size & ~1 );
     p_sys->i_out_offset += ( i_size & ~1 );
diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index c73deded85..ae3f6fe86b 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -31,6 +31,7 @@
 #include <assert.h>
 
 #include <vlc_common.h>
+#include <vlc_unistd.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 #include <vlc_aout.h>
@@ -400,7 +401,7 @@ static void U16LDecode( void *outp, const uint8_t *in, unsigned samples )
 
 static void S16IDecode( void *out, const uint8_t *in, unsigned samples )
 {
-    swab( in, out, samples * 2 );
+    vlc_swab( in, out, samples * 2 );
 }
 
 static void S20BDecode( void *outp, const uint8_t *in, unsigned samples )
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index 427685c68b..b5a7a1d033 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -30,12 +30,14 @@
 #endif
 
 #include <vlc_common.h>
+#include <vlc_unistd.h>
 #include <vlc_plugin.h>
 #include <vlc_demux.h>
 #include <vlc_codec.h>
 #include <vlc_codecs.h>
 #include <vlc_input.h>
 
+
 #include "../../packetizer/a52.h"
 #include "../../packetizer/dts_header.h"
 #include "../../meta_engine/ID3Tag.h"
@@ -638,7 +640,7 @@ static bool Parse( demux_t *p_demux, block_t **pp_output )
             if( p_block_in )
             {
                 block_CopyProperties( p_block_in, old );
-                swab( old->p_buffer, p_block_in->p_buffer, old->i_buffer );
+                vlc_swab( old->p_buffer, p_block_in->p_buffer, old->i_buffer );
             }
             block_Release( old );
         }
@@ -1301,7 +1303,7 @@ static int A52CheckSync( const uint8_t *p_peek, bool *p_big_endian, unsigned *pi
     *p_big_endian =  p_peek[0] == 0x0b && p_peek[1] == 0x77;
     if( !*p_big_endian )
     {
-        swab( p_peek, p_tmp, VLC_A52_MIN_HEADER_SIZE );
+        vlc_swab( p_peek, p_tmp, VLC_A52_MIN_HEADER_SIZE );
         p_peek = p_tmp;
     }
 
-- 
2.17.1



More information about the vlc-devel mailing list