Commit 97f1b5a9 authored by Thibault Saunier's avatar Thibault Saunier
Browse files

pipeline: Avoid committing the timeline while rendering

This can cause weird behavior and in particular it can lead to
de-synchronized audio/video streams.

Fixes GNOME/pitivi#2498
parent b679f6ba
Pipeline #246031 passed with stage
in 8 minutes and 49 seconds
......@@ -128,6 +128,9 @@ class EditorPerspective(Perspective, Loggable):
# Nothing to work with, Pitivi is starting up.
return
if self.app.project_manager.current_project.pipeline.rendering():
return
# Commit the timeline so its nested timelines assets are refreshed.
ges_timeline.commit()
......
......@@ -424,7 +424,7 @@ class SimplePipeline(GObject.Object, Loggable):
Gst.debug_bin_to_dot_file_with_ts(self._pipeline,
Gst.DebugGraphDetails.ALL,
"pitivi.error")
if not self._rendering():
if not self.rendering():
self._remove_waiting_for_async_done_timeout()
self._recover()
elif message.type == Gst.MessageType.DURATION_CHANGED:
......@@ -498,7 +498,7 @@ class SimplePipeline(GObject.Object, Loggable):
raise PipelineError("Couldn't get duration: Returned None")
return dur
def _rendering(self):
def rendering(self):
return False
......@@ -611,7 +611,7 @@ class Pipeline(GES.Pipeline, SimplePipeline):
# Nowhere to seek.
return
if self._rendering():
if self.rendering():
raise PipelineError("Trying to seek while rendering")
st = Gst.Structure.new_empty("seek")
......@@ -675,6 +675,6 @@ class Pipeline(GES.Pipeline, SimplePipeline):
self._was_empty = True
self._remove_waiting_for_async_done_timeout()
def _rendering(self):
def rendering(self):
mask = GES.PipelineFlags.RENDER | GES.PipelineFlags.SMART_RENDER
return self._pipeline.get_mode() & mask != 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