[pitivi] pipeline: Fix the usage of MAX_RECOVERIES
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] pipeline: Fix the usage of MAX_RECOVERIES
- Date: Tue, 13 Dec 2016 07:26:08 +0000 (UTC)
commit dc3adebf1ff0b5a732c4c425d7cb413eba267e1d
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Dec 7 15:04:46 2016 +0100
pipeline: Fix the usage of MAX_RECOVERIES
The pipeline was actually trying MAX_RECOVERIES + 1 recoveries.
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1548
pitivi/utils/pipeline.py | 2 +-
tests/test_pipeline.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 1731765..f0b42c3 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -449,7 +449,7 @@ class SimplePipeline(GObject.Object, Loggable):
def _recover(self):
if not self._bus:
raise PipelineError("Should not try to recover after destroy")
- if self._attempted_recoveries > MAX_RECOVERIES:
+ if self._attempted_recoveries == MAX_RECOVERIES:
self.emit("died")
self.error(
"Pipeline error detected multiple times in a row, not resetting anymore")
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 299f260..1b9d319 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -51,7 +51,7 @@ class TestPipeline(common.TestCase):
self.assertEqual(pipe._attempted_recoveries, 0)
self.assertFalse(pipeline_died_cb.called)
- for i in range(MAX_RECOVERIES + 1):
+ for i in range(MAX_RECOVERIES):
with mock.patch.object(pipe, "set_state") as set_state:
set_state.return_value = Gst.StateChangeReturn.SUCCESS
self.post_fake_error_message(pipe)
@@ -65,4 +65,4 @@ class TestPipeline(common.TestCase):
self.post_fake_error_message(pipe)
set_state.assert_not_called()
self.assertTrue(pipeline_died_cb.called)
- self.assertEqual(pipe._attempted_recoveries, MAX_RECOVERIES + 1)
+ self.assertEqual(pipe._attempted_recoveries, MAX_RECOVERIES)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]