[vlc-commits] [Git][videolan/vlc][master] stream_out: rtpfmt: trim raw video packets to written length

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Sep 2 06:29:04 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
c785d5da by Tristan Matthews at 2026-09-02T07:54:15+02:00
stream_out: rtpfmt: trim raw video packets to written length

Set i_buffer to the number of bytes actually written before sending.

Fixes #30083

- - - - -


1 changed file:

- modules/stream_out/rtpfmt.c


Changes:

=====================================
modules/stream_out/rtpfmt.c
=====================================
@@ -1956,6 +1956,10 @@ static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fo
             else vlc_assert_unreachable();
         }
 
+        /* Block was allocated before knowing how many (partial) lines fit,
+           so trim it to the bytes written. */
+        out->i_buffer = p_outdata - out->p_buffer;
+
         /* rtp common header */
         rtp_packetize_common( id, out, i_line_number >= i_height,
                 (in->i_pts != VLC_TICK_INVALID ? in->i_pts : in->i_dts) );



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

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