summaryrefslogtreecommitdiff
path: root/src/audio/fatfs_audio_input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/fatfs_audio_input.cpp')
-rw-r--r--src/audio/fatfs_audio_input.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/audio/fatfs_audio_input.cpp b/src/audio/fatfs_audio_input.cpp
index 7726a94a..29d32390 100644
--- a/src/audio/fatfs_audio_input.cpp
+++ b/src/audio/fatfs_audio_input.cpp
@@ -22,7 +22,6 @@
#include "ff.h"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
-#include "idf_additions.h"
#include "readahead_source.hpp"
#include "span.hpp"
@@ -62,9 +61,9 @@ auto FatfsAudioInput::SetPath(std::optional<std::string> path) -> void {
}
}
-auto FatfsAudioInput::SetPath(const std::string& path) -> void {
+auto FatfsAudioInput::SetPath(const std::string& path,uint32_t offset) -> void {
std::lock_guard<std::mutex> guard{new_stream_mutex_};
- if (OpenFile(path)) {
+ if (OpenFile(path, offset)) {
has_new_stream_ = true;
has_new_stream_.notify_one();
}
@@ -103,7 +102,7 @@ auto FatfsAudioInput::NextStream() -> std::shared_ptr<TaggedStream> {
}
}
-auto FatfsAudioInput::OpenFile(const std::string& path) -> bool {
+auto FatfsAudioInput::OpenFile(const std::string& path,uint32_t offset) -> bool {
ESP_LOGI(kTag, "opening file %s", path.c_str());
auto tags = tag_parser_.ReadAndParseTags(path);
@@ -136,7 +135,7 @@ auto FatfsAudioInput::OpenFile(const std::string& path) -> bool {
auto source =
std::make_unique<FatfsSource>(stream_type.value(), std::move(file));
- new_stream_.reset(new TaggedStream(tags, std::move(source)));
+ new_stream_.reset(new TaggedStream(tags, std::move(source), path, offset));
return true;
}