[UI] corrected segfault when enabling shuffle on en empty play queue
This commit is contained in:
@@ -111,6 +111,7 @@ class TrackSelector
|
|||||||
TrackSelector::TrackSelector()
|
TrackSelector::TrackSelector()
|
||||||
: _loop(false),
|
: _loop(false),
|
||||||
_shuffle(false),
|
_shuffle(false),
|
||||||
|
_size(0),
|
||||||
_curPos(0)
|
_curPos(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -152,11 +153,15 @@ TrackSelector::setShuffle(bool enable)
|
|||||||
{
|
{
|
||||||
_shuffle = enable;
|
_shuffle = enable;
|
||||||
|
|
||||||
|
if (_size != 0)
|
||||||
|
{
|
||||||
|
// Update the current index we are playing if we switch shuffle
|
||||||
if (_shuffle)
|
if (_shuffle)
|
||||||
setPosByRowId(_curPos);
|
setPosByRowId(_curPos);
|
||||||
else
|
else
|
||||||
setPos(_trackPos[_curPos]);
|
setPos(_trackPos[_curPos]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
TrackSelector::next()
|
TrackSelector::next()
|
||||||
|
|||||||
Reference in New Issue
Block a user