[pitivi] pipeline: Seek at the middle of the wanted frame when stepping frames
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] pipeline: Seek at the middle of the wanted frame when stepping frames
- Date: Thu, 11 Jun 2015 09:15:17 +0000 (UTC)
commit 7b597aff8027452d86f77a64a8d4e11daeacc27f
Author: Thibault Saunier <tsaunier gnome org>
Date: Sun Feb 8 13:29:25 2015 +0100
pipeline: Seek at the middle of the wanted frame when stepping frames
This way we are sure that it will pick exactly the frame we request and
not just the previous one (because of rounding issues in case of
floating framerates)
pitivi/utils/pipeline.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 0de95d6..55bf109 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -653,7 +653,8 @@ class Pipeline(GES.Pipeline, SimplePipeline):
cur_frame = int(
round(position * framerate.num / float(Gst.SECOND * framerate.denom), 2))
new_frame = cur_frame + frames_offset
- new_pos = int(new_frame * Gst.SECOND * framerate.denom / framerate.num)
+ new_pos = int(new_frame * Gst.SECOND * framerate.denom / framerate.num) + \
+ int((Gst.SECOND * framerate.denom / framerate.num) / 2)
Loggable.info(self, "From frame %d to %d at %f fps, seek to %s s",
cur_frame,
new_frame,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]