chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure we still send a 'completed' event in various dubious edge
[disorder]
/
server
/
play.c
diff --git
a/server/play.c
b/server/play.c
index aa5b8c7270eaa4e52c4114efc5e48a89ab7d22e7..9f54d615bf77d547fd240b2412d14f971f360855 100644
(file)
--- a/
server/play.c
+++ b/
server/play.c
@@
-83,8
+83,13
@@
static int speaker_readable(ev_source *ev, int fd,
case SM_FINISHED: /* scratched the playing track */
case SM_STILLBORN: /* scratched too early */
case SM_UNKNOWN: /* scratched WAY too early */
case SM_FINISHED: /* scratched the playing track */
case SM_STILLBORN: /* scratched too early */
case SM_UNKNOWN: /* scratched WAY too early */
- if(playing && !strcmp(sm.id, playing->id))
+ if(playing && !strcmp(sm.id, playing->id)) {
+ if((playing->state == playing_unplayed
+ || playing->state == playing_started)
+ && sm.type == SM_FINISHED)
+ playing->state = playing_ok;
finished(ev);
finished(ev);
+ }
break;
case SM_PLAYING:
/* track ID is playing, DATA seconds played */
break;
case SM_PLAYING:
/* track ID is playing, DATA seconds played */