Mercurial > hg > xmms-sid
comparison src/xmms-sid.c @ 345:ce140fff14c7
Off by one caused infinite looping in searching for next sub-tune to play,
fixed.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 23 Sep 2005 10:33:04 +0000 |
parents | e065deeb086f |
children | dc6cb365ace4 |
comparison
equal
deleted
inserted
replaced
344:a0fe42c5b6f4 | 345:ce140fff14c7 |
---|---|
364 { | 364 { |
365 /* Find a tune that has not been played */ | 365 /* Find a tune that has not been played */ |
366 XSDEBUG("tune #%i already played, finding next match ...\n", myStatus.currSong); | 366 XSDEBUG("tune #%i already played, finding next match ...\n", myStatus.currSong); |
367 isFound = FALSE; | 367 isFound = FALSE; |
368 i = 0; | 368 i = 0; |
369 while (!isFound && (i <= myTune->nsubTunes)) | 369 while (!isFound && (++i <= myTune->nsubTunes)) |
370 { | 370 { |
371 if (xs_cfg.subAutoMinOnly) | 371 if (xs_cfg.subAutoMinOnly) |
372 { | 372 { |
373 /* A tune with minimum length must be found */ | 373 /* A tune with minimum length must be found */ |
374 if (!playedTune[i] && myTune->subTunes[i].tuneLength >= xs_cfg.subAutoMinTime) | 374 if (!playedTune[i] && myTune->subTunes[i].tuneLength >= xs_cfg.subAutoMinTime) |
376 } else { | 376 } else { |
377 /* Any unplayed tune is okay */ | 377 /* Any unplayed tune is okay */ |
378 if (!playedTune[i]) | 378 if (!playedTune[i]) |
379 isFound = TRUE; | 379 isFound = TRUE; |
380 } | 380 } |
381 | |
382 /* currSong = i + 1 anyway, so we get it free here */ | |
383 i++; | |
384 } | 381 } |
385 | 382 |
386 if (isFound) | 383 if (isFound) |
387 { | 384 { |
388 /* Set the new sub-tune */ | 385 /* Set the new sub-tune */ |