After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757033 - scaletempo: Does not work properly with negative rates playback
scaletempo: Does not work properly with negative rates playback
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal major
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 756810
Blocks:
 
 
Reported: 2015-10-23 19:31 UTC by Sebastian Dröge (slomo)
Modified: 2015-10-27 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scaletempo: Fix processing of negative rates (1.51 KB, patch)
2015-10-23 19:44 UTC, Sebastian Dröge (slomo)
none Details | Review
scaletempo: Fix handling of rate < 0 (6.51 KB, patch)
2015-10-24 14:17 UTC, Sebastian Dröge (slomo)
none Details | Review
scaletempo: Fix handling of rate < 0 (9.33 KB, patch)
2015-10-24 16:59 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2015-10-23 19:31:01 UTC
See the backwards playback GstPlayer test for example, it times out when using scaletempo and finishes soonish otherwise.

https://github.com/sdroege/gst-player
Comment 1 Sebastian Dröge (slomo) 2015-10-23 19:44:28 UTC
Created attachment 313956 [details] [review]
scaletempo: Fix processing of negative rates

We just process them as positive rates and let the reversing of the buffers
happen downstream in the sink. As such, applied rate stays positive and rate
becomes -1.0.
Comment 2 Sebastian Dröge (slomo) 2015-10-23 19:49:27 UTC
This is actually not enough, it just makes it not deadlock. I think all samples need to be reversed to make the algorithm work smoothly.
Comment 3 Sebastian Dröge (slomo) 2015-10-23 22:20:54 UTC
Segment handling and other things are wrong, I'm on it
Comment 4 Sebastian Dröge (slomo) 2015-10-24 14:17:38 UTC
Created attachment 314019 [details] [review]
scaletempo: Fix handling of rate < 0

We have to reverse all samples in a buffer before processing them to properly
have continuous data from one buffer to another. As a result we will have a
negative applied rate and a rate of 1.0.

Also copy over the segment event's sequence number to the output segment while
we're at it.
Comment 5 Sebastian Dröge (slomo) 2015-10-24 16:59:37 UTC
Created attachment 314026 [details] [review]
scaletempo: Fix handling of rate < 0

We have to reverse all samples in a buffer before processing them to properly
have continuous data from one buffer to another. As a result we will have a
negative applied rate and a rate of 1.0.

Also make sure that input buffers are correctly clipped to the segment,
otherwise our calculations are going to go wrong.

Also copy over the segment event's sequence number to the output segment while
we're at it.
Comment 6 Sebastian Dröge (slomo) 2015-10-24 17:17:34 UTC
This depends on the patch from bug #756810
Comment 7 Sebastian Dröge (slomo) 2015-10-27 15:17:22 UTC
Attachment 314026 [details] pushed as ae3b903 - scaletempo: Fix handling of rate < 0
Comment 8 Sebastian Dröge (slomo) 2015-10-27 15:18:01 UTC
commit ae3b9030194abb6e51b9d26ce136a26088252196
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sat Oct 24 17:14:07 2015 +0300

    scaletempo: Fix handling of rate < 0
    
    We have to reverse all samples in a buffer before processing them to properly
    have continuous data from one buffer to another. As a result we will have a
    negative applied rate and a rate of 1.0.
    
    Also make sure that input buffers are correctly clipped to the segment,
    otherwise our calculations are going to go wrong.
    
    Also copy over the segment event's sequence number to the output segment while
    we're at it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757033