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
345f9442
Commit
345f9442
authored
Apr 17, 2024
by
schreibfaul1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setFilePos() without rangetest
verification of valid pos only in processLocalFile()
parent
86b8d634
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
src/Audio.cpp
src/Audio.cpp
+5
-6
src/Audio.h
src/Audio.h
+2
-2
No files found.
src/Audio.cpp
View file @
345f9442
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 26.2018
*
* Version 3.0.9
e
* Updated on: Apr 1
5
.2024
* Version 3.0.9
f
* Updated on: Apr 1
7
.2024
* Author: Wolle (schreibfaul1)
*
*/
...
...
@@ -3069,7 +3069,9 @@ void Audio::processLocalFile() {
if
(
m_resumeFilePos
>=
0
)
{
if
(
m_resumeFilePos
<
m_audioDataStart
)
m_resumeFilePos
=
m_audioDataStart
;
if
(
m_resumeFilePos
>
m_file_size
)
m_resumeFilePos
=
m_file_size
;
if
(
m_resumeFilePos
>
m_audioDataStart
+
m_audioDataSize
)
{
m_resumeFilePos
=
m_audioDataStart
+
m_audioDataSize
;}
m_haveNewFilePos
=
m_resumeFilePos
;
if
(
m_codec
==
CODEC_M4A
)
m_resumeFilePos
=
m4a_correctResumeFilePos
(
m_resumeFilePos
);
if
(
m_codec
==
CODEC_WAV
)
{
while
((
m_resumeFilePos
%
4
)
!=
0
)
m_resumeFilePos
++
;
...
...
@@ -3083,7 +3085,6 @@ void Audio::processLocalFile() {
InBuff
.
resetBuffer
();
byteCounter
=
m_resumeFilePos
;
f_fileDataComplete
=
false
;
// #570
m_haveNewFilePos
=
m_resumeFilePos
;
if
(
m_f_Log
)
{
log_i
(
"m_resumeFilePos %i"
,
m_resumeFilePos
);
...
...
@@ -4823,8 +4824,6 @@ bool Audio::setFilePos(uint32_t pos) {
if
(
!
audiofile
)
return
false
;
if
(
m_codec
==
CODEC_OPUS
)
return
false
;
// not impl. yet
if
(
m_codec
==
CODEC_VORBIS
)
return
false
;
// not impl. yet
if
(
pos
<
m_audioDataStart
)
{
pos
=
m_audioDataStart
;}
if
(
pos
>
m_audioDataStart
+
m_audioDataSize
)
{
pos
=
m_audioDataStart
+
m_audioDataSize
;
stopSong
();
return
false
;}
memset
(
m_outBuff
,
0
,
m_outbuffSize
);
m_validSamples
=
0
;
m_resumeFilePos
=
pos
;
// used in processLocalFile()
...
...
src/Audio.h
View file @
345f9442
...
...
@@ -3,8 +3,8 @@
*
* Created on: Oct 28,2018
*
* Version 3.0.9
e
* Updated on: Apr 1
5
.2024
* Version 3.0.9
f
* Updated on: Apr 1
7
.2024
* Author: Wolle (schreibfaul1)
*/
...
...
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