[vlc-commits] [Git][videolan/vlc][master] 9 commits: demux: ps: fix sign warning

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jan 15 15:22:19 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f95d3854 by Steve Lhomme at 2025-01-15T15:09:11+00:00
demux: ps: fix sign warning

i_skip is only set short values locally.

- - - - -
f9273a26 by Steve Lhomme at 2025-01-15T15:09:11+00:00
fluidsynth: fix warning when FLUIDSYNTH_VERSION_MAJOR is not defined

- - - - -
79bec383 by Steve Lhomme at 2025-01-15T15:09:11+00:00
goom: fix undefined WORDS_BIGENDIAN warning

- - - - -
5f568bb5 by Steve Lhomme at 2025-01-15T15:09:11+00:00
d3d11_scaler: fix AMFColor initialization warning

- - - - -
1ceec25d by Steve Lhomme at 2025-01-15T15:09:11+00:00
vout: decklink: use a condition variable to wait for the vout release

- - - - -
e3508d01 by Steve Lhomme at 2025-01-15T15:09:11+00:00
access: decklink: use vector instead of variable length array

- - - - -
7ffa8a4a by Steve Lhomme at 2025-01-15T15:09:11+00:00
vlc_atomic: avoid using atomic_init() in C++

It's deprecated in C++20. Setting the value directly is enough.

- - - - -
c9112e1f by Steve Lhomme at 2025-01-15T15:09:11+00:00
amt: fix pointer casts

It's all local code so we can use compatible types.

- - - - -
985688b4 by Steve Lhomme at 2025-01-15T15:09:11+00:00
mms: store network buffers are char

So it's compatible with the char* needed by the Windows API.

- - - - -


10 changed files:

- include/vlc_atomic.h
- modules/access/amt.c
- modules/access/decklink.cpp
- modules/access/mms/mmstu.c
- modules/access/mms/mmstu.h
- modules/codec/fluidsynth.c
- modules/demux/mpeg/ps.c
- modules/video_output/decklink.cpp
- modules/video_output/win32/d3d11_scaler.cpp
- modules/visualization/goom.c


Changes:

=====================================
include/vlc_atomic.h
=====================================
@@ -51,7 +51,11 @@ typedef struct vlc_atomic_rc_t {
 /** Init the RC to 1 */
 static inline void vlc_atomic_rc_init(vlc_atomic_rc_t *rc)
 {
+#ifndef __cplusplus
     atomic_init(&rc->refs, (uintptr_t)1);
+#else
+    rc->refs = (uintptr_t)1;
+#endif
 }
 
 /** Increment the RC */


=====================================
modules/access/amt.c
=====================================
@@ -1319,7 +1319,7 @@ static void amt_send_relay_request( stream_t *p_access, char *relay_ip )
  * Returns: the number of bytes written on success, else 0
  */
 
-static int serialize_ipv6_pkt(amt_ipv6_t *ip, uint8_t *buf, int buflen){
+static int serialize_ipv6_pkt(amt_ipv6_t *ip, char *buf, int buflen){
     if ( buflen < IPv6_HOP_BY_HOP_OPTION_LEN + IPv6_FIXED_HDR_LEN )
     {
         return 0;
@@ -1361,7 +1361,7 @@ static int serialize_ipv6_pkt(amt_ipv6_t *ip, uint8_t *buf, int buflen){
  * Returns: the number of bytes written on success, else 0
  */
 
-static int serialize_mld_report(amt_mldv2_listener_report_t *report, uint8_t *buf, int buflen, stream_t *p_access){
+static int serialize_mld_report(amt_mldv2_listener_report_t *report, char *buf, int buflen, stream_t *p_access){
     if ( buflen < MLD_REPORT_LEN )
     {
         return 0;


=====================================
modules/access/decklink.cpp
=====================================
@@ -52,6 +52,7 @@
 #include "sdi.h"
 
 #include <atomic>
+#include <vector>
 
 static int  Open (vlc_object_t *);
 static void Close(vlc_object_t *);
@@ -388,9 +389,9 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
                     uint32_t *buf;
                     if (vanc->GetBufferForVerticalBlankingLine(i, (void**)&buf) != S_OK)
                         break;
-                    uint16_t dec[width * 2];
-                    v210_convert(&dec[0], buf, width, 1);
-                    block_t *cc = vanc_to_cc(demux_, dec, width * 2);
+                    std::vector<uint16_t> dec(width);
+                    v210_convert(&dec.front(), buf, width, 1);
+                    block_t *cc = vanc_to_cc(demux_, &dec.front(), width * 2);
                     if (!cc)
                         continue;
                     cc->i_pts = cc->i_dts = VLC_TICK_0 + stream_time;


=====================================
modules/access/mms/mmstu.c
=====================================
@@ -1159,7 +1159,7 @@ static int NetFillBuffer( stream_t *p_access )
 }
 
 static int  mms_ParseCommand( stream_t *p_access,
-                              uint8_t *p_data,
+                              const char *p_data,
                               size_t i_data,
                               size_t *pi_used )
 {
@@ -1239,7 +1239,7 @@ static int  mms_ParseCommand( stream_t *p_access,
 }
 
 static int  mms_ParsePacket( stream_t *p_access,
-                             const uint8_t *p_data, size_t i_data,
+                             const char *p_data, size_t i_data,
                              size_t *pi_used )
 {
     access_sys_t        *p_sys = p_access->p_sys;


=====================================
modules/access/mms/mmstu.h
=====================================
@@ -50,10 +50,10 @@ typedef struct
     unsigned    i_timeout;
 
     /* */
-    uint8_t     buffer_tcp[MMS_BUFFER_SIZE];
+    char        buffer_tcp[MMS_BUFFER_SIZE];
     size_t      i_buffer_tcp;
 
-    uint8_t     buffer_udp[MMS_BUFFER_SIZE];
+    char        buffer_udp[MMS_BUFFER_SIZE];
     size_t      i_buffer_udp;
 
     /* data necessary to send data to server */


=====================================
modules/codec/fluidsynth.c
=====================================
@@ -297,7 +297,7 @@ static int DecodeBlock (decoder_t *p_dec, block_t *p_block)
         case 0x90:
             fluid_synth_noteon (p_sys->synth, channel, p1, p2);
             break;
-#if (FLUIDSYNTH_VERSION_MAJOR >= 2)
+#if defined(FLUIDSYNTH_VERSION_MAJOR) && (FLUIDSYNTH_VERSION_MAJOR >= 2)
         case 0xA0:
             fluid_synth_key_pressure (p_sys->synth, channel, p1, p2);
             break;


=====================================
modules/demux/mpeg/ps.c
=====================================
@@ -151,7 +151,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
     const uint8_t *p_peek;
     ssize_t i_peek = 0;
     ssize_t i_offset = 0;
-    uint64_t i_skip = 0;
+    int i_skip = 0;
     unsigned i_max_packets = PS_PACKET_PROBE;
     int format = MPEG_PS;
     int i_mux_rate = 0;


=====================================
modules/video_output/decklink.cpp
=====================================
@@ -289,6 +289,7 @@ vlc_module_end ()
 
 /* Protects decklink_sys_t creation/deletion */
 static vlc::threads::mutex sys_lock;
+static vlc::threads::condition_variable cond_video;
 
 static decklink_sys_t *HoldDLSys(vlc_object_t *obj, int i_cat)
 {
@@ -306,10 +307,8 @@ static decklink_sys_t *HoldDLSys(vlc_object_t *obj, int i_cat)
         {
             while(sys->b_videomodule)
             {
-                sys_lock.unlock();
                 msg_Info(obj, "Waiting for previous vout module to exit");
-                vlc_tick_sleep(VLC_TICK_FROM_MS(100));
-                sys_lock.lock();
+                cond_video.wait(sys_lock);
             }
         }
     }
@@ -365,6 +364,7 @@ static void ReleaseDLSys(vlc_object_t *obj, int i_cat)
     {
         sys->b_videomodule = false;
         sys->b_recycling = true;
+        cond_video.signal();
     }
 
     sys_lock.unlock();


=====================================
modules/video_output/win32/d3d11_scaler.cpp
=====================================
@@ -405,7 +405,8 @@ int D3D11_UpscalerUpdate(vlc_object_t *vd, d3d11_scaler *scaleProc, d3d11_device
             res = scaleProc->amf_scaler->SetProperty(AMF_HQ_SCALER_FROM_SRGB, 0);
             res = scaleProc->amf_scaler->SetProperty(AMF_HQ_SCALER_SHARPNESS, 0.5);
             res = scaleProc->amf_scaler->SetProperty(AMF_HQ_SCALER_FILL, 1);
-            AMFColor black{0,0,0,255};
+            AMFColor black{};
+            black.a = 255;
             res = scaleProc->amf_scaler->SetProperty(AMF_HQ_SCALER_FILL_COLOR, black);
             // res = scaleProc->amf_scaler->SetProperty(AMF_HQ_SCALER_FRAME_RATE, oFrameRate);
             auto amf_fmt = DXGIToAMF(scaleProc->d3d_fmt->formatTexture);


=====================================
modules/visualization/goom.c
=====================================
@@ -37,8 +37,17 @@
 #include <vlc_filter.h>
 #include <vlc_picture_pool.h>
 
+#ifndef WORDS_BIGENDIAN
+#define WORDS_BIGENDIAN 0
+#define DEFINED_WORDS_BIGENDIAN
+#endif
+
 #include <goom/goom.h>
 
+#ifdef DEFINED_WORDS_BIGENDIAN
+#undef WORDS_BIGENDIAN
+#endif
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -388,4 +397,3 @@ static void Close( filter_t *p_filter )
     video_format_Clean(&p_thread->fmt);
     free( p_thread );
 }
-



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8fc394a0e021c1dffc2fa5248944b3ff363bf635...985688b4c49dc82ddbf5aaa26e1f272a76385616

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8fc394a0e021c1dffc2fa5248944b3ff363bf635...985688b4c49dc82ddbf5aaa26e1f272a76385616
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list