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 stream) -> bool { } stream->SetPreambleFinished(); - if (open_res->total_samples) { - timer_.reset(new Timer(std::shared_ptr{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{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) { lua_pushinteger(L, arg);