basesrc: Make locking of the segment a bit more strict and update documentation
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 12 Feb 2010 13:49:52 +0000 (14:49 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 12 Feb 2010 13:58:42 +0000 (14:58 +0100)
commitfae502056f8a6c84a8428142a4a319b346eb922c
treea4ecf8231e912356679f6bd81c41a87cf9866efe
parent8d1c45f513419091d09ca12e98cd89f59fc926e7
basesrc: Make locking of the segment a bit more strict and update documentation

Updating the segment values must only be done while holding the
STREAM_LOCK and OBJECT_LOCK. This means, reading can be done as
long as one of them is held, not both, which removes some lock-unlock
blocks from performance critical code paths.

Also document, that gst_base_src_set_format() *must* be called in
states <= READY and add an assertion for this. Changing the format
later will completely mess up the segment information.
libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasesrc.h