From 81c778a52912507f3406377147c9e6ee58abb09d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 May 2024 14:43:07 +0200 Subject: [PATCH] SongUpdate: use Storage::OpenFile() --- src/SongUpdate.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index b2e4281a3..4b5947249 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -7,9 +7,12 @@ #include "db/plugins/simple/Directory.hxx" #include "storage/StorageInterface.hxx" #include "storage/FileInfo.hxx" +#include "input/InputStream.hxx" +#include "input/WaitReady.hxx" #include "decoder/DecoderList.hxx" #include "fs/AllocatedPath.hxx" #include "fs/FileInfo.hxx" +#include "thread/Mutex.hxx" #include "tag/Builder.hxx" #include "TagFile.hxx" #include "TagStream.hxx" @@ -64,9 +67,10 @@ Song::UpdateFile(Storage &storage, const StorageFileInfo &info) try { const auto path_fs = storage.MapFS(relative_uri); if (path_fs.IsNull()) { - const auto absolute_uri = - storage.MapUTF8(relative_uri); - if (!tag_stream_scan(absolute_uri.c_str(), tag_builder, + Mutex mutex; + const auto is = storage.OpenFile(relative_uri, mutex); + LockWaitReady(*is); + if (!tag_stream_scan(*is, tag_builder, &new_audio_format)) return false; } else {