Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
b85e638a by Tristan Matthews at 2023-03-30T06:06:02+00:00
opus: log header details
- - - - -
6febbf9b by Tristan Matthews at 2023-03-30T06:06:02+00:00
opus_header: fix endianness
According to https://www.rfc-editor.org/rfc/rfc7845, the Opus header values are all
little-endian, not big-endian.
- - - - -
2 changed files:
- modules/codec/opus.c
- modules/codec/opus_header.c
Changes:
=====================================
modules/codec/opus.c
=====================================
@@ -428,7 +428,9 @@ static int ProcessInitialHeader( decoder_t *p_dec, ogg_packet *p_oggpacket )
         msg_Err( p_dec, "cannot read Opus header" );
         return VLC_EGENERIC;
     }
-    msg_Dbg( p_dec, "Opus audio with %d channels", p_header->channels);
+
+    msg_Dbg( p_dec, "Opus audio with %d channels, %d samples preskip, %d samplerate",
+             p_header->channels, p_header->preskip, p_header->input_sample_rate );
 
     if((p_header->channels>2 && p_header->channel_mapping==0) ||
         (p_header->channels>8 && p_header->channel_mapping==1) ||
=====================================
modules/codec/opus_header.c
=====================================
@@ -78,7 +78,7 @@ static int write_uint32(Packet *p, uint32_t val)
 {
     if (p->pos>p->maxlen-4)
         return 0;
-    SetDWBE(&p->data[p->pos], val);
+    SetDWLE(&p->data[p->pos], val);
     p->pos += 4;
     return 1;
 }
@@ -87,7 +87,7 @@ static int write_uint16(Packet *p, uint16_t val)
 {
     if (p->pos>p->maxlen-2)
         return 0;
-    SetWBE(&p->data[p->pos], val);
+    SetWLE(&p->data[p->pos], val);
     p->pos += 2;
     return 1;
 }
@@ -105,7 +105,7 @@ static int read_uint32(ROPacket *p, uint32_t *val)
 {
     if (p->pos>p->maxlen-4)
         return 0;
-    *val = GetDWBE(&p->data[p->pos]);
+    *val = GetDWLE(&p->data[p->pos]);
     p->pos += 4;
     return 1;
 }
@@ -114,7 +114,7 @@ static int read_uint16(ROPacket *p, uint16_t *val)
 {
     if (p->pos>p->maxlen-2)
         return 0;
-    *val = GetWBE(&p->data[p->pos]);
+    *val = GetWLE(&p->data[p->pos]);
     p->pos += 2;
     return 1;
 }
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4c6222e6c33501aac8c68b7d4596151d588cf16b...6febbf9bb75a1713118984745439cb4b29c6fde5
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4c6222e6c33501aac8c68b7d4596151d588cf16b...6febbf9bb75a1713118984745439cb4b29c6fde5
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance