[vlc-commits] [Git][videolan/vlc][master] demux: mp4: work around mp3 in v0

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Apr 19 13:22:57 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
452e477e by François Cartegnie at 2026-04-19T14:47:49+02:00
demux: mp4: work around mp3 in v0

handles v0 or v1 MPGA having bytesperssample and samplesize and
compression being 0, ending up reading samplesperframe instead of
 the number of stored samples units

samples/mov/test3sansIRAP.mp4

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -4258,6 +4258,22 @@ static inline uint32_t MP4_GetAudioFrameInfo( const mp4_track_t *p_track,
         i_samples_per_frame = p_soun->i_constLPCMframesperaudiopacket;
         i_bytes_per_frame = p_soun->i_constbytesperaudiopacket;
     }
+
+    /* handle v0 or v1 MPGA having bytesperssample and samplesize and
+     * compression being 0.
+     * ends up reading samplesperframe instead of the number of
+     * stored samples units */
+    if( p_soun->i_compressionid == 0 && p_soun->i_qt_version <= 1 &&
+        p_track->i_sample_size > 0 &&
+        (
+            p_track->fmt.i_codec == VLC_CODEC_MP3 ||
+            p_track->fmt.i_codec == VLC_CODEC_MP2 ||
+            p_track->fmt.i_codec == VLC_CODEC_MPGA
+        ) )
+    {
+        i_bytes_per_frame = 0;
+    }
+
 #ifdef MP4_DEBUG_AUDIO_SAMPLES
     printf("qtv%d comp%x ss %d chan %d ba %d spp %d bpf %d / %d %d\n",
            p_soun->i_qt_version, p_soun->i_compressionid,



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/452e477e178fb47ee0aa92550b087e57eaf30fc7
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list