[gnome-sound-recorder/gnome-3-12] listview.js, play.js, record.js: More error handling
- From: Meg Ford (Margaret) <megford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/gnome-3-12] listview.js, play.js, record.js: More error handling
- Date: Mon, 2 Jun 2014 06:16:49 +0000 (UTC)
commit bf6e11deefac4f24355182e4bcf3d158971ba14a
Author: Meg Ford <megford gnome org>
Date: Mon Jun 2 00:51:46 2014 -0500
listview.js, play.js, record.js: More error handling
src/listview.js | 9 ++++-----
src/play.js | 4 ++--
src/record.js | 8 ++++----
3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/listview.js b/src/listview.js
index 847d4e5..b115cdb 100644
--- a/src/listview.js
+++ b/src/listview.js
@@ -301,13 +301,12 @@ const Listview = new Lang.Class({
} else if (audioCaps.can_intersect(this.capTypes(AudioProfile.audioCodecMap.FLAC))) {
allFilesInfo[this.idx].mediaType = mediaTypeMap.FLAC;
- } else {
+ }
- if (allFilesInfo[this.idx].mediaType == null) {
+ if (allFilesInfo[this.idx].mediaType == null) {
// Remove the file from the array if we don't recognize it
- allFilesInfo.splice(this.idx, 1);
- }
- }
+ allFilesInfo.splice(this.idx, 1);
+ }
},
capTypes: function(capString) {
diff --git a/src/play.js b/src/play.js
index 94e0280..dafa099 100644
--- a/src/play.js
+++ b/src/play.js
@@ -78,8 +78,8 @@ const _TENTH_SEC = 100000000;
this.playState = PipelineStates.PLAYING;
if (this.ret == Gst.StateChangeReturn.FAILURE) {
- this._showErrorDialog(_('Unable to play recording'));
- this.onEndOfStream();
+ this._showErrorDialog(_('Unable to play recording'));
+ this.play.set_state(Gst.State.NULL);
} else if (this.ret == Gst.StateChangeReturn.SUCCESS) {
MainWindow.view.setVolume();
}
diff --git a/src/record.js b/src/record.js
index 69f33fc..7b54c8c 100644
--- a/src/record.js
+++ b/src/record.js
@@ -154,8 +154,8 @@ const Record = new Lang.Class({
this.pipeState = PipelineStates.PLAYING;
if (ret == Gst.StateChangeReturn.FAILURE) {
- this._showErrorDialog(_('Unable to set the pipeline \n to the recording state'));
- this._buildFileName.getTitle().delete_async(GLib.PRIORITY_DEFAULT, null, null);
+ this._showErrorDialog(_('Unable to set the pipeline \n to the recording state'));
+ this._buildFileName.getTitle().delete_async(GLib.PRIORITY_DEFAULT, null, null);
} else {
MainWindow.view.setVolume();
}
@@ -204,8 +204,8 @@ const Record = new Lang.Class({
if (description != null)
errorTwo = description;
-
- this._showErrorDialog(errorOne, errorTwo);
+ this.pipeline.set_state(Gst.State.NULL);
+ log(errorOne, errorTwo);
}
let s = message.get_structure();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]