GNOME Bugzilla – Bug 765662
adapter: invalid returned distance when getting prev pts/dts at offset
Last modified: 2016-11-12 08:40:37 UTC
Created attachment 326844 [details] [review] patch fixing the issue The function gst_adapter_prev_pts_at_offset and gst_adapter_prev_dts_at_offset does not return the correct distance. It always returns the distance without taking care of the pts/dts offset found which does not seems correct regarding the description. I have attach a patch that fix the issue.
Any chance you could add a short unit test for this too? :)
I will try to make a quick one :)
Created attachment 326864 [details] [review] unit tests
Created attachment 326865 [details] small test program
Running the small test executable I have the following results: Without the fix: ** Message: offset 0 PTS=0:00:00.000000000 distance=0 ** Message: offset 2048 PTS=0:00:00.000000000 distance=2048 ** Message: offset 4096 PTS=0:00:00.023219955 distance=4096 ** Message: offset 6144 PTS=0:00:00.046439910 distance=6144 ** Message: offset 8192 PTS=0:00:00.069659865 distance=8192 ** Message: offset 10240 PTS=0:00:00.092879820 distance=10240 ** Message: offset 12288 PTS=0:00:00.116099775 distance=12288 ** Message: offset 14336 PTS=0:00:00.139319730 distance=14336 ** Message: offset 16384 PTS=0:00:00.162539685 distance=16384 ** Message: offset 18432 PTS=0:00:00.185759640 distance=18432 With the fix: ** Message: offset 0 PTS=0:00:00.000000000 distance=0 ** Message: offset 2048 PTS=0:00:00.000000000 distance=2048 ** Message: offset 4096 PTS=0:00:00.023219955 distance=2048 ** Message: offset 6144 PTS=0:00:00.046439910 distance=2048 ** Message: offset 8192 PTS=0:00:00.069659865 distance=2048 ** Message: offset 10240 PTS=0:00:00.092879820 distance=2048 ** Message: offset 12288 PTS=0:00:00.116099775 distance=2048 ** Message: offset 14336 PTS=0:00:00.139319730 distance=2048 ** Message: offset 16384 PTS=0:00:00.162539685 distance=2048 ** Message: offset 18432 PTS=0:00:00.185759640 distance=2048
Comment on attachment 326864 [details] [review] unit tests Can you make the unit tests a patch against gstreamer/tests/check/libs/gstadapter.c?
Created attachment 327518 [details] [review] patch for adapter unit tests
Thanks, pushed with minor changes (adapter: fix conflicts, test: use fail_unless_equals_int): commit 9ae9a01fe2d454b954bd53918b53103c3972db02 Author: Nicolas Huet <nicolas.huet@parrot.com> Date: Mon May 9 15:32:43 2016 +0200 tests: add unit test for gst_adapter_prev_pts_at_offset() https://bugzilla.gnome.org/show_bug.cgi?id=765662 commit 9cd2677791bc25c9ad1885c86b40ac0b3328dd31 Author: Nicolas Huet <nicolas.huet@parrot.com> Date: Wed Apr 27 10:57:29 2016 +0200 adapter: fix distance when getting prev pts/dts at offset https://bugzilla.gnome.org/show_bug.cgi?id=765662