DetachedSong: compare start_time and end_time in IsSame()

This method is used by DecoderControl::IsCurrentSong(), which is used
by the player thread to check whether the current decoder instance can
be reused to seek.  When switching to another song in the same CUE
sheet, previously DetachedSong::IsSame() returned true, and thus the
old decoder instance was used for the new song, not considering the
new end_time.  This led to the old decoder quickly quitting.
This commit is contained in:
Max Kellermann 2017-01-15 00:54:09 +01:00
parent 7e8b448985
commit e847ddf011
2 changed files with 5 additions and 1 deletions

2
NEWS
View File

@ -11,6 +11,8 @@ ver 0.20.2 (not yet released)
- alsa: fix the DSD_U32 byte order
- alsa: support DSD_U16
- recorder: fix error "Failed to create : No such file or directory"
* playlist
- cue: fix skipping songs
ver 0.20.1 (2017/01/09)
* input

View File

@ -146,7 +146,9 @@ public:
*/
gcc_pure
bool IsSame(const DetachedSong &other) const {
return uri == other.uri;
return uri == other.uri &&
start_time == other.start_time &&
end_time == other.end_time;
}
gcc_pure gcc_nonnull_all