[vlc-commits] [Git][videolan/vlc][master] mpeg12: update "offset" after each MPEG Audio frame

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 10 02:49:10 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a11c28e4 by Rémi Denis-Courmont at 2026-09-10T02:34:28+00:00
mpeg12: update "offset" after each MPEG Audio frame

`sys->offset` is the notionally the byte offset up to which the current
fragmented frame is in the defragmentation buffer. But if we are dealing
with multiple small frames in a single packet, then it really is the
amount of data available in the defragmentation buffer (which then consists
of a single block).

We need to update the offset after each frame for the boundary checks of the
following frames to work correctly.

Fixes #30079.

- - - - -


1 changed file:

- modules/access/rtp/mpeg12.c


Changes:

=====================================
modules/access/rtp/mpeg12.c
=====================================
@@ -180,6 +180,7 @@ static void rtp_mpa_decode(struct vlc_rtp_pt *pt, void *data, block_t *block,
         block_t *frame = block_Alloc(fh.i_frame_size);
         if (likely(frame != NULL)) {
             assert(block->p_next == NULL); /* Only one block to copy from */
+            assert(block->i_buffer >= frame->i_buffer);
             memcpy(frame->p_buffer, block->p_buffer, frame->i_buffer);
             frame->i_flags = block->i_flags;
             frame->i_pts = block->i_pts;
@@ -192,6 +193,7 @@ static void rtp_mpa_decode(struct vlc_rtp_pt *pt, void *data, block_t *block,
         block->p_buffer += fh.i_frame_size;
         block->i_buffer -= fh.i_frame_size;
         block->i_pts = VLC_TICK_INVALID;
+        sys->offset -= fh.i_frame_size;
     }
     return;
 



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

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