[pitivi] Fix traceback previewing audio stream. Fixes #597790.



commit 0e6d977a06080b22b0f900211e8263db71686051
Author: Alessandro Decina <alessandro d gmail com>
Date:   Thu Oct 8 15:38:32 2009 +0200

    Fix traceback previewing audio stream. Fixes #597790.

 pitivi/ui/previewer.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py
index 36e00d3..ab285e6 100644
--- a/pitivi/ui/previewer.py
+++ b/pitivi/ui/previewer.py
@@ -494,6 +494,12 @@ class RandomAccessAudioPreviewer(RandomAccessPreviewer):
             x = 0
             while i < len(samples):
                 slice = samples[i:i + stride:channels]
+                if not slice:
+                    self.warning("empty slice??")
+                    i += spp
+                    x += 1
+                    continue
+
                 min_ = min(slice)
                 max_ = max(slice)
                 cr.move_to(x, y - (min_ * hscale))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]