commit 98e865465b38c5c9c94d133276f483c18e5b55bd
parent 6ea9814a56f0a2009917ccfbf3441522e62fa746
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Sat, 10 Jul 2010 13:41:43 +1000
Don't start the pipeline on error
Diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/spek-pipeline.vala b/src/spek-pipeline.vala
@@ -85,15 +85,15 @@ namespace Spek {
if (cx.error != null) {
// TRANSLATORS: first %s is the error message, second %s is stream description.
description = _("%s: %s").printf (cx.error, description);
+ } else {
+ this.sample_rate = cx.sample_rate;
+ this.nfft = 2 * bands - 2;
+ this.fft = new Fft.Plan (nfft, threshold);
+ this.input_size = nfft * (NFFT * 2 + 1);
+ this.input = new float[input_size];
+ this.output = new float[bands];
+ this.cx.start (samples);
}
-
- this.sample_rate = cx.sample_rate;
- this.nfft = 2 * bands - 2;
- this.fft = new Fft.Plan (nfft, threshold);
- this.input_size = nfft * (NFFT * 2 + 1);
- this.input = new float[input_size];
- this.output = new float[bands];
- this.cx.start (samples);
}
~Pipeline () {
@@ -103,6 +103,8 @@ namespace Spek {
public void start () {
stop ();
+ if (cx.error != null) return;
+
input_pos = 0;
reader_mutex = new Mutex ();
reader_cond = new Cond ();