chiark / gitweb /
empty track buffers aren't unplayable if at eof
[disorder] / server / speaker.c
index dc9b9813fd17ab591e03f63a25b33df7dcce56ff..a6c5f43e16f4f560b869422013fc0895ca5dd7f6 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * This file is part of DisOrder
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
+ * Portions (C) 2007 Mark Wooding
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -351,8 +352,10 @@ static void speaker_play(size_t frames) {
   if(!playing->used || playing->start == (sizeof playing->buffer))
     playing->start = 0;
   /* If the buffer emptied out mark the track as unplayably */
-  if(!playing->used)
+  if(!playing->used && !playing->eof) {
+    error(0, "track buffer emptied");
     playing->playable = 0;
+  }
   frames -= written_frames;
   return;
 }