summaryrefslogtreecommitdiff
path: root/js/dbusServices/screencast/screencastService.js
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2023-04-26 19:13:27 +0200
committerMarge Bot <marge-bot@gnome.org>2023-04-26 18:02:57 +0000
commit846bb84ff6666a82633d68800e61918d212d6568 (patch)
treef6091b990683c74c6337cabe421e5765f995e6e1 /js/dbusServices/screencast/screencastService.js
parent6476e62bff910ae7a781fe962f22bc5939c51ba9 (diff)
downloadgnome-shell-846bb84ff6666a82633d68800e61918d212d6568.tar.gz
screencastService: Fixup pipeline fallback behavior
Calling _teardownPipeline() before _tryNextPipeline() was actually not a good idea, it sets the pipelineState to STOPPED, which means we can't try any of the following pipelines anymore. Instead what we want to do is set the pipeline state of the old pipeline to NULL when trying a new one, without calling _teardownPipeline() for that. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2754>
Diffstat (limited to 'js/dbusServices/screencast/screencastService.js')
-rw-r--r--js/dbusServices/screencast/screencastService.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/dbusServices/screencast/screencastService.js b/js/dbusServices/screencast/screencastService.js
index d63dd8087..6ab92b53e 100644
--- a/js/dbusServices/screencast/screencastService.js
+++ b/js/dbusServices/screencast/screencastService.js
@@ -197,11 +197,17 @@ var Recorder = class extends Signals.EventEmitter {
_tryNextPipeline() {
const {done, value: pipelineConfig} = this._pipelineConfigs.next();
if (done) {
- this._teardownPipeline();
this._handleFatalPipelineError('All pipelines failed to start');
return;
}
+ if (this._pipeline) {
+ if (this._pipeline.set_state(Gst.State.NULL) !== Gst.StateChangeReturn.SUCCESS)
+ log('Failed to set pipeline state to NULL');
+
+ this._pipeline = null;
+ }
+
try {
this._pipeline = this._createPipeline(this._nodeId, pipelineConfig,
this._framerate);
@@ -224,7 +230,6 @@ var Recorder = class extends Signals.EventEmitter {
retval === Gst.StateChangeReturn.ASYNC) {
// We'll wait for the state change message to PLAYING on the bus
} else {
- this._teardownPipeline();
this._tryNextPipeline();
}
}