Commit 9654a332 authored by Fredrik Noring's avatar Fredrik Noring Committed by Max Kellermann

decoder/sidplay: Fix empty album names by using the SID name field

SID files are generally collections of tunes, so a SID name field makes sense as an MPD album. The SID tune information list (STIL) has name and title fields for individual tunes, when such are known, but MPD is currently not using the STIL.
parent 9bcd02d1
...@@ -11,6 +11,7 @@ ver 0.22 (not yet released) ...@@ -11,6 +11,7 @@ ver 0.22 (not yet released)
- iso9660: support seeking - iso9660: support seeking
* decoder * decoder
- sidplay: add option "default_genre" - sidplay: add option "default_genre"
- sidplay: map SID name field to "Album" tag
* filter * filter
- ffmpeg: new plugin based on FFmpeg's libavfilter library - ffmpeg: new plugin based on FFmpeg's libavfilter library
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback - hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
......
...@@ -510,16 +510,18 @@ static void ...@@ -510,16 +510,18 @@ static void
ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks, ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks,
TagHandler &handler) noexcept TagHandler &handler) noexcept
{ {
/* title */ /* album */
const auto title = GetInfoString(info, 0); const auto album = GetInfoString(info, 0);
handler.OnTag(TAG_ALBUM, album.c_str());
if (n_tracks > 1) { if (n_tracks > 1) {
const auto tag_title = const auto tag_title =
StringFormat<1024>("%s (%u/%u)", StringFormat<1024>("%s (%u/%u)",
title.c_str(), track, n_tracks); album.c_str(), track, n_tracks);
handler.OnTag(TAG_TITLE, tag_title.c_str()); handler.OnTag(TAG_TITLE, tag_title.c_str());
} else } else
handler.OnTag(TAG_TITLE, title.c_str()); handler.OnTag(TAG_TITLE, album.c_str());
/* artist */ /* artist */
const auto artist = GetInfoString(info, 1); const auto artist = GetInfoString(info, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment