summaryrefslogtreecommitdiff
path: root/src/SongUpdate.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-06 13:22:17 +0200
committerMax Kellermann <max@musicpd.org>2018-07-06 22:49:02 +0200
commit72b6c09a738d53ce2860e8c4ae86e7c17b1dac8f (patch)
tree790a66244b398b11cd67bdb776bc0971070654c6 /src/SongUpdate.cxx
parentc05bca6f2ce3efc57f903577697717f5ee1784cf (diff)
db/simple: add an AudioFormat to each Song
Diffstat (limited to 'src/SongUpdate.cxx')
-rw-r--r--src/SongUpdate.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index e43c45961..5738955b3 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -77,19 +77,23 @@ Song::UpdateFile(Storage &storage) noexcept
return false;
TagBuilder tag_builder;
+ auto new_audio_format = AudioFormat::Undefined();
const auto path_fs = storage.MapFS(relative_uri.c_str());
if (path_fs.IsNull()) {
const auto absolute_uri =
storage.MapUTF8(relative_uri.c_str());
- if (!tag_stream_scan(absolute_uri.c_str(), tag_builder))
+ if (!tag_stream_scan(absolute_uri.c_str(), tag_builder,
+ &new_audio_format))
return false;
} else {
- if (!ScanFileTagsWithGeneric(path_fs, tag_builder))
+ if (!ScanFileTagsWithGeneric(path_fs, tag_builder,
+ &new_audio_format))
return false;
}
mtime = info.mtime;
+ audio_format = new_audio_format;
tag_builder.Commit(tag);
return true;
}