Merge tag 'v0.20.18'

release v0.20.18
This commit is contained in:
Max Kellermann
2018-02-24 23:16:06 +01:00
16 changed files with 120 additions and 51 deletions

View File

@@ -229,6 +229,7 @@ CueParser::Feed2(char *p) noexcept
}
state = TRACK;
ignore_index = false;
current = std::make_unique<DetachedSong>(filename);
assert(!current->GetTag().IsDefined());
@@ -238,6 +239,9 @@ CueParser::Feed2(char *p) noexcept
} else if (state == IGNORE_TRACK) {
return;
} else if (state == TRACK && strcmp(command, "INDEX") == 0) {
if (ignore_index)
return;
const char *nr = cue_next_token(&p);
if (nr == nullptr)
return;
@@ -255,7 +259,7 @@ CueParser::Feed2(char *p) noexcept
current->SetStartTime(SongTime::FromMS(position_ms));
if(strcmp(nr, "00") != 0 || previous == nullptr)
state = IGNORE_TRACK;
ignore_index = true;
}
}

View File

@@ -87,6 +87,13 @@ class CueParser {
*/
std::unique_ptr<DetachedSong> finished;
/**
* Ignore "INDEX" lines? Only up the first one after "00" is
* used. If there is a pregap (INDEX 00..01), it is assigned
* to the previous song.
*/
bool ignore_index;
/**
* Tracks whether Finish() has been called. If true, then all
* remaining (partial) results will be delivered by Get().