[vlc-devel] [PATCH v2] access_output: udp: fix conversion from uint8_t* on Windows

Alexandre Janniaux ajanni at videolabs.io
Fri Mar 27 16:10:49 CET 2020


It fixes warning on uint8_t* being used as char* in Windows API, as
Windows's `send` takes a char* instead of a void*.

Like discussed on the mailing list, casting to char* would be incorrect
to pass blob of data in all platforms and most API other than Windows
require a void*, so casting here is a no-op on most platform and remove
the warning on Windows.
---
 modules/access_output/udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 6fe59bbbaa..648247bb92 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -393,7 +393,7 @@ static void* ThreadWrite( void *data )
             vlc_tick_wait( i_date );
             i_to_send = i_group;
         }
-        if ( send( p_sys->i_handle, p_pk->p_buffer, p_pk->i_buffer, 0 ) == -1 )
+        if ( send( p_sys->i_handle, (const void*)p_pk->p_buffer, p_pk->i_buffer, 0 ) == -1 )
             msg_Warn( p_access, "send error: %s", vlc_strerror_c(errno) );
         vlc_cleanup_pop();
 
-- 
2.26.0



More information about the vlc-devel mailing list