[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-1/amarok/src/scripts/shouter
From:       James Bellenger <jbellenger () pristine ! gm>
Date:       2005-04-28 11:34:16
Message-ID: 20050428113416.825F7666 () office ! kde ! org
[Download RAW message or body]

CVS commit by bellenger: 

Fixed problem with playlist snapshot streams not resuming playback after sleeping.


  M +13 -14    Services.py   1.5


--- kdeextragear-1/amarok/src/scripts/shouter/Services.py  #1.4:1.5
@@ -83,11 +83,9 @@
 
     def stream_silence(self, br):
-        debug('stream_silence %d' % br)
-        as = Amarok.state
-        while Amarok.state == as:
-            fobj = Playlist.SilentFile(br)
-            self.meta_is_dirty = True
-            self.stream(fobj, 0)
-        self.meta_is_dirty = True
+        #debug('stream_silence %d' % br)
+        #as = Amarok.state
+        #while Amarok.state == as:
+        fobj = Playlist.SilentFile(br)
+        self.stream(fobj, 0)
             
 
@@ -109,5 +107,5 @@
         f.seek(fsize * pos + mp3_start)
 
-        #debug('starting stream bc=%d' % bc)
+        self.meta_is_dirty = True
         while f.tell() < fsize and eval(condition):
             bytes_till_meta = icy_int - self.byte_count
@@ -131,4 +129,5 @@
                 sleep_int = len(buf) * sleep_factor
                 time.sleep(sleep_int)
+        self.meta_is_dirty = True
 
         
@@ -164,12 +163,14 @@
                 (fobj, frac) = self.pl.get_play_cursor() 
                 self.check_format(fobj)
-                self.meta_is_dirty = True
                 as = Amarok.state
                 condition = '%d == Amarok.state' % as
                 self.stream(fobj, frac, condition)
             except (bad_format_error, amarok_not_playing_error, indeterminate_queue_error):
-                # FIXME: This sucks and is usable only for testing
-                #self.stream_silence(192)
-                self.stream_silence(48)
+                # FIXME:
+                # 48 seems to be the limit for a 44.1 kHz, 2-channel 2-second file
+                # Any lower and things start to mysteriously break
+                as = Amarok.state
+                while Amarok.state == as:
+                    self.stream_silence(48)
 
 
@@ -199,7 +200,5 @@
             try:
                 (fobj, frac) = self.pl.get_play_cursor() 
-                # TODO: add format checking
                 self.check_format(fobj)
-                self.meta_is_dirty = True
                 self.stream(fobj, frac)
             except bad_format_error:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic