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
4af9f399
Commit
4af9f399
authored
Aug 28, 2023
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid a crash if the codebook is not in the usual place
parent
c612a077
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
src/Audio.cpp
src/Audio.cpp
+5
-2
src/vorbis_decoder/vorbis_decoder.cpp
src/vorbis_decoder/vorbis_decoder.cpp
+6
-3
No files found.
src/Audio.cpp
View file @
4af9f399
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.6
* Updated on: Aug
05
.2023
* Version 3.0.6
a
* Updated on: Aug
28
.2023
* Author: Wolle (schreibfaul1)
*
*/
...
...
@@ -1227,6 +1227,9 @@ size_t Audio::readAudioHeader(uint32_t bytes){
if
(
m_codec
==
CODEC_VORBIS
){
m_controlCounter
=
100
;
}
if
(
m_codec
==
CODEC_OGG
){
m_controlCounter
=
100
;
}
if
(
!
isRunning
()){
log_e
(
"Processing stopped due to invalid audio header"
);
return
0
;
...
...
src/vorbis_decoder/vorbis_decoder.cpp
View file @
4af9f399
...
...
@@ -15,7 +15,7 @@
* adapted for the ESP32 by schreibfaul1
*
* Created on: 13.02.2023
* Updated on:
02.07
.2023
* Updated on:
23.08
.2023
*/
//----------------------------------------------------------------------------------------------------------------------
// O G G I M P L.
...
...
@@ -191,13 +191,16 @@ int VORBISDecode(uint8_t *inbuf, int *bytesLeft, short *outbuf){
else
{
log_e
(
"no
\"
vorbis
\"
something went wrong %i"
,
len
);
}
s_pageNr
=
3
;
// log_w("s_vorbisSegmentTableSize %d", s_vorbisSegmentTableSize);
// Normally the segment table has two entries, the first for comments and the second for the codebooks
if
(
!
s_vorbisSegmentTableSize
)
{;}
//there is no further segment for codebooks -> skip it
else
s_pageNr
=
3
;
}
else
if
(
s_pageNr
==
3
){
// setup header
int
idx
=
VORBIS_specialIndexOf
(
inbuf
,
"vorbis"
,
10
);
s_oggPage3Len
=
len
;
if
(
idx
==
1
){
//
log_i("third packet (setup len) %i", len);
log_i
(
"third packet (setup len) %i"
,
len
);
s_setupHeaderLength
=
len
;
bitReader_setData
(
inbuf
,
len
);
...
...
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