Commit 3b957173 authored by Meg Ford's avatar Meg Ford

Temporary fix for waveforms

The Gst level element does not properly read files with one channel.
There is now a fix for this in Gst master branch.
Add temporary workaround until the fix is released.
https://bugzilla.gnome.org/show_bug.cgi?id=742028
https://bugzilla.gnome.org/show_bug.cgi?id=746065
parent 3f890ad2
......@@ -79,6 +79,9 @@ const Record = new Lang.Class({
}
this.pipeline.add(this.srcElement);
this.audioConvert = Gst.ElementFactory.make("audioconvert", "audioConvert");
this.pipeline.add(this.audioConvert);
this.caps = Gst.Caps.from_string("audio/x-raw, channels=2");
this.clock = this.pipeline.get_clock();
this.recordBus = this.pipeline.get_bus();
this.recordBus.add_signal_watch();
......@@ -124,12 +127,13 @@ const Record = new Lang.Class({
this.onEndOfStream();
}
let srcLink = this.srcElement.link(this.level);
let srcLink = this.srcElement.link(this.audioConvert);
let audioConvertLink = this.audioConvert.link_filtered(this.level, this.caps);
let levelLink = this.level.link(this.volume);
let volLink = this.volume.link(this.ebin);
let ebinLink = this.ebin.link(this.filesink);
if (!srcLink || !levelLink || !ebinLink) {
if (!srcLink || !audioConvertLink || !levelLink || !ebinLink) {
this._showErrorDialog(_("Not all of the elements were linked."));
errorDialogState = ErrState.ON;
this.onEndOfStream();
......
......@@ -90,8 +90,8 @@ const WaveForm = new Lang.Class({
_launchPipeline: function() {
this.pipeline =
Gst.parse_launch("uridecodebin name=decode uri=" + this._uri + " ! audioconvert ! audio/x-raw,channels=1 !level name=level interval=100000000 post-messages=true ! fakesink qos=false");
this._level = this.pipeline.get_by_name("wavelevel");
Gst.parse_launch("uridecodebin name=decode uri=" + this._uri + " ! audioconvert ! audio/x-raw,channels=2 ! level name=level interval=100000000 post-messages=true ! fakesink qos=false");
this._level = this.pipeline.get_by_name("level");
let decode = this.pipeline.get_by_name("decode");
let bus = this.pipeline.get_bus();
bus.add_signal_watch();
......@@ -253,7 +253,7 @@ const WaveForm = new Lang.Class({
},
endDrawing: function() {
if(this.pipeline)
if (this.pipeline)
this.stopGeneration();
this.count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment