videotestsrc: keep track of the correct running time after renegotiations
authorThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 29 Aug 2012 19:02:11 +0000 (16:02 -0300)
committerTim-Philipp Müller <tim@centricular.net>
Sun, 23 Sep 2012 16:48:56 +0000 (17:48 +0100)
commit386206e627b45fb7c6d64dec188ddf67ad80c1da
tree3e3d5612a42de56760f32597320635294c42331a
parentcec6d634b607cd490971551906dbceeb3b1f36cb
videotestsrc: keep track of the correct running time after renegotiations

Need to store the old running time and frame numbers when renegotiating and
start from 0 again when a new caps is set, preventing that framerate changes
cause timestamping issues.

For example, if a stream pushed 10 buffers on framerate=2/1, its
running time will be 5s. If a new framerate of 1/1 is set, it would
make the running time go to 10s as it would count those 10 buffers
as being sent on this new framerate.

Fixes camerbin unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=682973
gst/videotestsrc/gstvideotestsrc.c
gst/videotestsrc/gstvideotestsrc.h