fix issues with some song info not appearing

custom
jacqueline 1 year ago
parent 52f5e95acb
commit 200a43fad3
  1. 18
      src/audio/audio_decoder.cpp
  2. 2
      src/lua/property.cpp

@ -139,17 +139,13 @@ auto Decoder::BeginDecoding(std::shared_ptr<TaggedStream> stream) -> bool {
} }
stream->SetPreambleFinished(); stream->SetPreambleFinished();
if (open_res->total_samples) { timer_.reset(new Timer(std::shared_ptr<Track>{new Track{
timer_.reset(new Timer(std::shared_ptr<Track>{new Track{ .tags = stream->tags(),
.tags = stream->tags(), .db_info = {},
.db_info = {}, .bitrate_kbps = open_res->sample_rate_hz,
.bitrate_kbps = 0, .encoding = stream->type(),
.encoding = stream->type(), }},
}}, open_res.value()));
open_res.value()));
} else {
timer_.reset();
}
current_sink_format_ = IAudioOutput::Format{ current_sink_format_ = IAudioOutput::Format{
.sample_rate = open_res->sample_rate_hz, .sample_rate = open_res->sample_rate_hz,

@ -183,7 +183,7 @@ static auto pushTagValue(lua_State* L, const database::TagValue& val) -> void {
for (const auto& i : arg) { for (const auto& i : arg) {
lua_pushlstring(L, i.data(), i.size()); lua_pushlstring(L, i.data(), i.size());
lua_pushboolean(L, true); lua_pushboolean(L, true);
lua_rawset(L, -2); lua_rawset(L, -3);
} }
} else if constexpr (std::is_same_v<T, uint32_t>) { } else if constexpr (std::is_same_v<T, uint32_t>) {
lua_pushinteger(L, arg); lua_pushinteger(L, arg);

Loading…
Cancel
Save