[vlc-commits] [Git][videolan/vlc][master] 7 commits: access: rist: end stream on session timeout

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon May 18 13:49:48 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a02c02ed by Sergio Ammirata at 2026-05-18T13:20:09+00:00
access: rist: end stream on session timeout

The stats callback sets p_sys->eof when librist reports a session
timeout, but BlockRIST never read it. Check it under the existing
lock and return *eof = true.

- - - - -
596e297a by Sergio Ammirata at 2026-05-18T13:20:09+00:00
access_output: rist: pass chunk size as payload_len

- - - - -
cc9aefe3 by Sergio Ammirata at 2026-05-18T13:20:09+00:00
qt: sout: rist: pass cname instead of unknown stream-name option

- - - - -
d8895780 by Sergio Ammirata at 2026-05-18T13:20:09+00:00
qt: sout: rist: drop unused mux member

- - - - -
536d657a by Sergio Ammirata at 2026-05-18T13:20:09+00:00
access: rist: pass SRP username and password to librist

The SRP username and password were inherited from the VLC config and
freed at the end of rist_add_peers, but never copied into
app_peer_config. EAP/SRP authentication was silently disabled even
when the user configured credentials on the URL or via vlcrc.

- - - - -
168844c1 by Sergio Ammirata at 2026-05-18T13:20:09+00:00
access_output: rist: propagate sender errors and account written bytes

Replace the int i_len accumulator with a size_t one populated from the
return of rist_sender_data_write, which is dropped today. Three issues
folded into one fix:

 - rist_sender_data_write() returns int (bytes accepted, or -1 on
   queue-full / fatal error). The previous code ignored it, so VLC sout
   never learned about a failed transmit.
 - i_len accumulated the input length rather than what the sender
   actually consumed, so a partial chain would have reported a
   misleading positive count even after the inner write failed.
 - Widening to size_t closes the original int overflow primitive on
   '+= p_buffer->i_buffer'.

On error the chain is released with block_ChainRelease and the function
returns -1, matching the ssize_t contract that VLC sout expects. The
return narrowing from size_t to ssize_t is bounded:

    i_len <= chain_len * RIST_MAX_PACKET_SIZE (= 10000)

so it always fits well below SSIZE_MAX without an explicit clamp.

- - - - -
6cc2553d by Sergio Ammirata at 2026-05-18T13:20:09+00:00
contrib: librist: bump to v0.2.15

Security-fixes release. ABI 10:3:6 (soversion 4), binary-compatible
with v0.2.14, so the contrib bump only needs the version + SHA-512
update.

Changelog: https://code.videolan.org/rist/librist/-/releases/v0.2.15

- - - - -


7 changed files:

- contrib/src/librist/SHA512SUMS
- contrib/src/librist/rules.mak
- modules/access/rist.c
- modules/access/rist.h
- modules/access_output/rist.c
- modules/gui/qt/dialogs/sout/sout_widgets.cpp
- modules/gui/qt/dialogs/sout/sout_widgets.hpp


Changes:

=====================================
contrib/src/librist/SHA512SUMS
=====================================
@@ -1 +1 @@
-eb730efb2c1d59177e85fb0da0ecc9c6db42ccfff3cd8bde7ef6df4bd13c623d0ac489abb0bb9c3f63bb43b7730903436c434a9f5d7f5d5314c12f3af905135b  librist-v0.2.14.tar.gz
+906382576025b39b9ac13e4ad20648b5c2a61e215d7dc0d30e043dc3c30d6fd9586c7349cfeb2c5fd4c576e833c16dbe003c6f774a6372ea1bfc3c4fefa81663  librist-v0.2.15.tar.gz


=====================================
contrib/src/librist/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # librist
 
-LIBRIST_VERSION := v0.2.14
+LIBRIST_VERSION := v0.2.15
 LIBRIST_URL := https://code.videolan.org/rist/librist/-/archive/$(LIBRIST_VERSION)/librist-$(LIBRIST_VERSION).tar.gz
 
 ifdef BUILD_NETWORK


=====================================
modules/access/rist.c
=====================================
@@ -140,6 +140,18 @@ static block_t *BlockRIST(stream_t *p_access, bool *restrict eof)
     i_rist_items_index = i_flags = i_total_size = 0;
     int i_read_timeout_ms = p_sys->i_maximum_jitter;
 
+    /* The stats callback sets p_sys->eof when librist reports a session
+     * timeout (status == 2). Propagate it here so VLC ends the stream
+     * instead of polling forever for data that will never arrive. */
+    vlc_mutex_lock( &p_sys->lock );
+    if (p_sys->eof) {
+        vlc_mutex_unlock( &p_sys->lock );
+        msg_Err(p_access, "RIST session timed out, ending stream");
+        *eof = true;
+        return NULL;
+    }
+    vlc_mutex_unlock( &p_sys->lock );
+
     while ((ret = rist_receiver_data_read2(p_sys->receiver_ctx, &rist_buffer, i_read_timeout_ms)) > 0)
     {
         if (p_sys->gre_filter_dst_port > 0 && rist_buffer->virt_dst_port != p_sys->gre_filter_dst_port) {


=====================================
modules/access/rist.h
=====================================
@@ -208,6 +208,16 @@ static inline bool rist_add_peers(vlc_object_t *p_this, struct rist_ctx *ctx, ch
             strlcpy(app_peer_config.cname, psz_stream_name, sizeof(app_peer_config.cname));
         }
 
+        if (psz_srp_username != NULL && psz_srp_username[0] != '\0') {
+            strlcpy(app_peer_config.srp_username, psz_srp_username,
+                    sizeof(app_peer_config.srp_username));
+        }
+
+        if (psz_srp_password != NULL && psz_srp_password[0] != '\0') {
+            strlcpy(app_peer_config.srp_password, psz_srp_password,
+                    sizeof(app_peer_config.srp_password));
+        }
+
         // URL overrides (also cleans up the URL)
         struct rist_peer_config *peer_config = &app_peer_config;
         if (rist_parse_address2(addr[i], &peer_config))


=====================================
modules/access_output/rist.c
=====================================
@@ -107,7 +107,7 @@ static int cb_stats(void *arg, const struct rist_stats *stats_container)
 static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
-    int i_len = 0;
+    size_t i_len = 0;
 
     struct rist_data_block rist_buffer = { 0 };
     rist_buffer.virt_src_port = p_sys->gre_src_port;
@@ -117,14 +117,21 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
     {
         block_t *p_next;
 
-        i_len += p_buffer->i_buffer;
-
         while( p_buffer->i_buffer )
         {
             size_t i_write = __MIN( p_buffer->i_buffer, p_sys->i_max_packet_size );
             rist_buffer.payload = p_buffer->p_buffer;
-            rist_buffer.payload_len = p_buffer->i_buffer;
-            rist_sender_data_write(p_sys->sender_ctx, &rist_buffer);
+            rist_buffer.payload_len = i_write;
+
+            int written = rist_sender_data_write(p_sys->sender_ctx, &rist_buffer);
+            if( written < 0 )
+            {
+                msg_Warn( p_access, "rist_sender_data_write failed (chunk=%zu)", i_write );
+                block_ChainRelease( p_buffer );
+                return -1;
+            }
+
+            i_len += (size_t)written;
             p_buffer->p_buffer += i_write;
             p_buffer->i_buffer -= i_write;
         }
@@ -132,9 +139,10 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         p_next = p_buffer->p_next;
         block_Release( p_buffer );
         p_buffer = p_next;
-
     }
-    return i_len;
+
+    /* i_len <= chain_len * RIST_MAX_PACKET_SIZE (10000); always fits in ssize_t. */
+    return (ssize_t)i_len;
 }
 
 static int Control( sout_access_out_t *p_access, int i_query, va_list args )


=====================================
modules/gui/qt/dialogs/sout/sout_widgets.cpp
=====================================
@@ -415,8 +415,8 @@ QString SRTDestBox::getMRL(const QString&)
     return m.to_string();
 }
 
-RISTDestBox::RISTDestBox( QWidget *_parent, const char *_mux )
-    : VirtualDestBox( _parent ), mux( qfu(_mux) )
+RISTDestBox::RISTDestBox( QWidget *_parent, const char * )
+    : VirtualDestBox( _parent )
 {
     label->setText( qtr( "This module outputs the stream using the RIST protocol (TR06).") );
 
@@ -456,7 +456,7 @@ QString RISTDestBox::getMRL( const QString& )
     m.begin( "std" );
     if( !name.isEmpty() )
     {
-        m.option( "access", "rist{stream-name=" + name + "}" );
+        m.option( "access", "rist{cname=" + name + "}" );
     }
     else
     {


=====================================
modules/gui/qt/dialogs/sout/sout_widgets.hpp
=====================================
@@ -140,7 +140,6 @@ class RISTDestBox: public VirtualDestBox
         QLineEdit *RISTAddress;
         QSpinBox *RISTPort;
         QLineEdit *RISTName;
-        QString mux;
 };
 
 class RTPDestBox: public VirtualDestBox



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a50b73257123b397cf6b6c6241dbc9eeb1cf946a...6cc2553d858325610bbdb3607264f3f8032581c2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a50b73257123b397cf6b6c6241dbc9eeb1cf946a...6cc2553d858325610bbdb3607264f3f8032581c2
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list