summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-01-18 14:49:07 +1100
committerjacqueline <me@jacqueline.id.au>2024-01-18 14:49:07 +1100
commit200a43fad309813c3ebbc3da35dbb97367bde7ac (patch)
tree48fe31bcc1f792119a90226b1b419582ab2b29ec
parent52f5e95acbb071e2614926b84616e335131439d6 (diff)
downloadtangara-fw-200a43fad309813c3ebbc3da35dbb97367bde7ac.tar.gz
fix issues with some song info not appearing
-rw-r--r--src/audio/audio_decoder.cpp18
-rw-r--r--src/lua/property.cpp2
2 files changed, 8 insertions, 12 deletions
diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
index fd011c51..5b057240 100644
--- a/src/audio/audio_decoder.cpp
+++ b/src/audio/audio_decoder.cpp
@@ -139,17 +139,13 @@ auto Decoder::BeginDecoding(std::shared_ptr<TaggedStream> stream) -> bool {
}
stream->SetPreambleFinished();
- if (open_res->total_samples) {
- timer_.reset(new Timer(std::shared_ptr<Track>{new Track{
- .tags = stream->tags(),
- .db_info = {},
- .bitrate_kbps = 0,
- .encoding = stream->type(),
- }},
- open_res.value()));
- } else {
- timer_.reset();
- }
+ timer_.reset(new Timer(std::shared_ptr<Track>{new Track{
+ .tags = stream->tags(),
+ .db_info = {},
+ .bitrate_kbps = open_res->sample_rate_hz,
+ .encoding = stream->type(),
+ }},
+ open_res.value()));
current_sink_format_ = IAudioOutput::Format{
.sample_rate = open_res->sample_rate_hz,
diff --git a/src/lua/property.cpp b/src/lua/property.cpp
index c16434fa..33600ee8 100644
--- a/src/lua/property.cpp
+++ b/src/lua/property.cpp
@@ -183,7 +183,7 @@ static auto pushTagValue(lua_State* L, const database::TagValue& val) -> void {
for (const auto& i : arg) {
lua_pushlstring(L, i.data(), i.size());
lua_pushboolean(L, true);
- lua_rawset(L, -2);
+ lua_rawset(L, -3);
}
} else if constexpr (std::is_same_v<T, uint32_t>) {
lua_pushinteger(L, arg);