changeset 403:26a73a4647cb

ascoltami cache filling
author Drew Perttula <drewp@bigasterisk.com>
date Sun, 17 Jun 2007 22:57:43 +0000
parents e748d6edd375
children 25308bc6d767
files bin/ascoltami
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bin/ascoltami	Sun Jun 17 22:42:25 2007 +0000
+++ b/bin/ascoltami	Sun Jun 17 22:57:43 2007 +0000
@@ -196,12 +196,22 @@
         self.mpd.add(showconfig.songInMpd(MUS['preSong']))
         self.mpd.add(showconfig.songInMpd(song))
         self.mpd.add(showconfig.songInMpd(MUS['postSong']))
+
+        self.fillCache(song)
+        
         self.filename_var.set(graph.value(song, L9['showPath']))
         self.song_uri = song
 
         self.set_total_time(song)
         self.seek_to(-4)
 
+    def fillCache(self, song):
+        """read the song's entire wav file into memory just before
+        playing, so that mpd should never hit the disk during
+        playback. On score in 2007, we had some mpd stutters that were
+        always timed with a disk read."""
+        open(showconfig.songOnDisk(song)).read()
+
     def check_autopause(self):
         pause_time = self.total_time.get() + self.song_pad_time
         t = self.current_time.get()