Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ESP32-audioI2S
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ESP32-audioI2S
Commits
3f91f452
Commit
3f91f452
authored
Mar 08, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wrong frame length in FramePacking Code2
see
https://www.tech-invite.com/y65/tinv-ietf-rfc-6716-2.html
page 17
parent
83b59746
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/opus_decoder/opus_decoder.cpp
src/opus_decoder/opus_decoder.cpp
+6
-3
No files found.
src/opus_decoder/opus_decoder.cpp
View file @
3f91f452
...
...
@@ -3,7 +3,7 @@
* based on Xiph.Org Foundation celt decoder
*
* Created on: 26.01.2023
* Updated on: 0
7
.03.2024
* Updated on: 0
8
.03.2024
*/
//----------------------------------------------------------------------------------------------------------------------
// O G G / O P U S I M P L.
...
...
@@ -335,6 +335,9 @@ int8_t opus_FramePacking_Code2(uint8_t *inbuf, int *bytesLeft, short *outbuf, in
MUST also be no larger than the size of the payload remaining after decoding that length for all code 2 packets. This makes, for example,
a 2-byte code 2 packet with a second byte in the range 1...251 invalid as well (the only valid 2-byte code 2 packet is one where the length of
both frames is zero).
compute N1: o 1...251: Length of the frame in bytes
o 252...255: A second byte is needed. The total length is (second_byte*4)+first_byte
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...
...
@@ -358,7 +361,7 @@ int8_t opus_FramePacking_Code2(uint8_t *inbuf, int *bytesLeft, short *outbuf, in
if
(
*
frameCount
==
0
){
uint8_t
b1
=
inbuf
[
1
];
uint8_t
b2
=
inbuf
[
2
];
if
(
b1
!=
255
){
if
(
b1
<
252
){
firstFrameLength
=
b1
;
packetLen
-=
2
;
*
bytesLeft
-=
2
;
...
...
@@ -366,11 +369,11 @@ int8_t opus_FramePacking_Code2(uint8_t *inbuf, int *bytesLeft, short *outbuf, in
inbuf
+=
2
;
}
else
{
firstFrameLength
=
b1
+
(
b2
*
4
);
packetLen
-=
3
;
*
bytesLeft
-=
3
;
s_opusCurrentFilePos
+=
3
;
inbuf
+=
3
;
firstFrameLength
=
b1
+
b2
;
}
secondFrameLength
=
packetLen
-
firstFrameLength
;
*
frameCount
=
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment