[Bug 756810] segment_to_stream_time and position_from_stream_time miscalculate when applied_rate < 0

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Oct 20 00:43:39 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=756810

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slomo at coaxion.net
 Attachment #313668|none                        |committed
             status|                            |

--- Comment #4 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Comment on attachment 313668
  --> https://bugzilla.gnome.org/attachment.cgi?id=313668
Added unit tests for rate > 0 and applied_rate < 0

commit 45f0f354ac34618d6f6adf20b0bffcf14a3f0a29
Author: Vivia Nikolaidou <vivia at ahiru.eu>
Date:   Mon Oct 19 16:50:51 2015 +0300

    segment: Correct stream_time calc for negative applied rate

    Updated gst_segment_position_from_stream_time and
gst_segment_to_stream_time to reflect correct calculations for the case when
the applied rate is negative.

    Pasting from design docs:

    ===============================
    Stream time is calculated using the buffer times and the preceding SEGMENT
    event as follows:

        stream_time = (B.timestamp - S.start) * ABS (S.applied_rate) + S.time

    For negative rates, B.timestamp will go backwards from S.stop to S.start,
    making the stream time go backwards.
    ===============================

    Therefore, the calculation for applied_rate < 0 should be:

        stream_time = (S.stop - B.timestamp) * ABS (S.applied_rate) + S.time

    and the reverse:

        B.timestamp = S.stop - (stream_time - S.time) / ABS (S.applied_rate)

    https://bugzilla.gnome.org/show_bug.cgi?id=756810

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list