[gnome-sound-recorder] Bug 756993



commit 41fba8a6bda05f97eac1b12a1decb3bc9482b059
Author: Meg Ford <megford gnome org>
Date:   Thu Oct 29 19:44:15 2015 -0500

    Bug 756993
    
    Check for a null clock before getting the time.

 src/play.js   |   11 ++++++++++-
 src/record.js |   11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/play.js b/src/play.js
index c4fe641..017042f 100644
--- a/src/play.js
+++ b/src/play.js
@@ -188,7 +188,16 @@ const Play = new Lang.Class({
             MainWindow.view.setLabel(0);
         }
 
-        let absoluteTime = this.clock.get_time();
+        let absoluteTime = 0;
+
+        if  (this.clock == null) {
+            this.clock = this.play.get_clock();
+        }
+        try {
+            absoluteTime = this.clock.get_time();
+        } catch(error) {
+            // no-op
+        }
 
         if (this.baseTime == 0)
             this.baseTime = absoluteTime;
diff --git a/src/record.js b/src/record.js
index f58a1be..f455f59 100644
--- a/src/record.js
+++ b/src/record.js
@@ -247,7 +247,16 @@ const Record = new Lang.Class({
                             let value = Math.pow(10, val/20);
                             this.peak = value;
 
-                            this.absoluteTime = this.clock.get_time();
+
+                            if  (this.clock == null) {
+                                this.clock = this.pipeline.get_clock();
+                            }
+                            try {
+                                this.absoluteTime = this.clock.get_time();
+                            } catch(error) {
+                                this.absoluteTime = 0;
+                            }
+
 
                             if (this.baseTime == 0)
                                 this.baseTime = this.absoluteTime;


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