song/DetachedSong: copy the AudioFormat from LightSong
Enables the "Format" row in "playlistinfo" responses. https://github.com/MusicPlayerDaemon/MPD/issues/1094
This commit is contained in:
@@ -86,8 +86,7 @@ song_save(BufferedOutputStream &os, const DetachedSong &song)
|
||||
|
||||
DetachedSong
|
||||
song_load(TextFile &file, const char *uri,
|
||||
std::string *target_r,
|
||||
AudioFormat *audio_format_r)
|
||||
std::string *target_r)
|
||||
{
|
||||
DetachedSong song(uri);
|
||||
|
||||
@@ -113,13 +112,11 @@ song_load(TextFile &file, const char *uri,
|
||||
if (target_r != nullptr)
|
||||
*target_r = value;
|
||||
} else if (StringIsEqual(line, "Format")) {
|
||||
if (audio_format_r != nullptr) {
|
||||
try {
|
||||
*audio_format_r =
|
||||
ParseAudioFormat(value, false);
|
||||
} catch (...) {
|
||||
/* ignore parser errors */
|
||||
}
|
||||
try {
|
||||
song.SetAudioFormat(ParseAudioFormat(value,
|
||||
false));
|
||||
} catch (...) {
|
||||
/* ignore parser errors */
|
||||
}
|
||||
} else if (StringIsEqual(line, "Playlist")) {
|
||||
tag.SetHasPlaylist(StringIsEqual(value, "yes"));
|
||||
|
||||
Reference in New Issue
Block a user