[vlc-commits] [Git][videolan/vlc][master] access_output: srt: fix signedness warning

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sun May 1 14:58:03 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
596311ba by Alexandre Janniaux at 2022-05-01T14:40:42+00:00
access_output: srt: fix signedness warning

i_payload_size cannot be <= 0 anyway, and we now guarantee it by
having a fallback to the default value in those case.

- - - - -


1 changed file:

- modules/access_output/srt.c


Changes:

=====================================
modules/access_output/srt.c
=====================================
@@ -38,7 +38,7 @@ typedef struct
     int           i_poll_id;
     bool          b_interrupted;
     vlc_mutex_t   lock;
-    int           i_payload_size;
+    size_t        i_payload_size;
     block_bytestream_t block_stream;
 } sout_access_out_sys_t;
 
@@ -68,7 +68,11 @@ static bool srt_schedule_reconnect(sout_access_out_t *p_access)
     char *psz_dst_addr = NULL;
     int i_dst_port;
     int i_latency=var_InheritInteger( p_access, SRT_PARAM_LATENCY );
+
     int i_payload_size = var_InheritInteger( p_access, SRT_PARAM_PAYLOAD_SIZE );
+    if (i_payload_size <= 0)
+        i_payload_size = SRT_DEFAULT_PAYLOAD_SIZE;
+
     char *psz_passphrase = var_InheritString( p_access, SRT_PARAM_PASSPHRASE );
     bool passphrase_needs_free = true;
     char *psz_streamid = var_InheritString( p_access, SRT_PARAM_STREAMID );
@@ -184,7 +188,7 @@ static bool srt_schedule_reconnect(sout_access_out_t *p_access)
                 SRTO_STREAMID, psz_streamid, strlen(psz_streamid) );
     }
 
-    /* set maximumu payload size */
+    /* set maximum payload size */
     stat = srt_set_socket_option( access_obj, SRT_PARAM_PAYLOAD_SIZE, p_sys->sock,
             SRTO_PAYLOADSIZE, &i_payload_size, sizeof(i_payload_size) );
     if ( stat == SRT_ERROR )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/596311ba0bc7e66867b1ec18f91864d22927a629

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/596311ba0bc7e66867b1ec18f91864d22927a629
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