chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
1f2a5e5
)
Ensure we still send a 'completed' event in various dubious edge
author
Richard Kettlewell
<rjk@greenend.org.uk>
Sun, 13 Dec 2009 15:53:42 +0000
(15:53 +0000)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Sun, 13 Dec 2009 15:53:42 +0000
(15:53 +0000)
cases, especially common in scratching.
server/play.c
patch
|
blob
|
blame
|
history
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 */
- 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);
+ }
break;
case SM_PLAYING:
/* track ID is playing, DATA seconds played */