[vlc-commits] [Git][videolan/vlc][master] demux: ogg: report 48 kHz as the Opus sample rate
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Aug 21 18:26:01 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e94dce30 by Alaric Senat at 2026-08-21T18:09:30+00:00
demux: ogg: report 48 kHz as the Opus sample rate
Previous code is setting the fmt's sample rate as the "Input Sample
Rate", the original audio samplerate prior to opus encoding.
Opus always encode at 48kHz, the current code does not cause playback
bugs because the opus codec ignore the audio format rate and assume 48khz.
Muxers don't ignore this value however, this caused problems in the Opus
in mp4 implementation reporting incorrect playback times.
- - - - -
1 changed file:
- modules/demux/ogg.c
Changes:
=====================================
modules/demux/ogg.c
=====================================
@@ -2925,6 +2925,7 @@ static void Ogg_ReadOpusHeader( logical_stream_t *p_stream,
* can be played at 48kHz. */
date_Init( &p_stream->dts, 48000, 1 );
p_stream->fmt.i_bitrate = 0;
+ p_stream->fmt.audio.i_rate = 48000;
/* Cheat and get additional info ;) */
oggpack_readinit( &opb, p_oggpacket->packet, p_oggpacket->bytes);
oggpack_adv( &opb, 64 );
@@ -2932,8 +2933,7 @@ static void Ogg_ReadOpusHeader( logical_stream_t *p_stream,
{
p_stream->fmt.audio.i_channels = oggpack_read( &opb, 8 );
p_stream->i_pre_skip = oggpack_read( &opb, 16 );
- p_stream->fmt.audio.i_rate = oggpack_read( &opb, 32 );
- oggpack_adv( &opb, 16 );
+ oggpack_adv( &opb, 32 + 16 ); /* Skip Input Sample Rate and Output Gain */
switch( oggpack_read( &opb, 8 ) ) /* mapping family */
{
case 0: /* RFC7587 */
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e94dce30f9c04404e1537eddc7585ce7f7ae40af
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e94dce30f9c04404e1537eddc7585ce7f7ae40af
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