Only update the last_stop value when we had a valid stop position for the
clipping or else the clipping code assumes the stop position extends to the end
of the segment, which makes the position reporting return weird values.
Unify the different position reporting code paths to make it more
understandable.
Use start_time to get more accurate position reporting in paused.
Fix unit tests for more accurate reporting.
Use atomic ops to read and write more properties. Taking the preroll lock in get_property
can lock up applications reading the property during preroll.
Add a new enable-last-buffer property. When false, it disables storing the last
received buffer in basesink::last-buffer. This can be useful in cases where
buffers need to be released asap.
API: GstBaseSink::enable-last-buffer
For the reason outlined at the beginning of gst_private.h (inline
functions in glib may need the g_log_domain variable). Also include
gst_private.h before using any G_OS_* defines, esp. in plugin loader.
This allows demuxers to update the segment stop of an already
finished stream. This might be needed if some stream goes to
EOS before the duration of the longest stream is known to properly
set the segment stop of all streams to the same value in the end.
Rounding errors with the floating point rate could make it so that we
don't end up exactly at the required stepping duration.
Use the segment clipping boundaries, which are not subject to rate
adjustements, instead to detect when we reached the stepping duration.
Add some debug info related to going to the PAUSED state.
When clamping the base time, correctly use 'now', instead of
'-now' - the intent is to prevent 'now-base' ever being
negative, which would cause a position report outside the segment.
Fixes: #602419
Element base_time is a signed quantity, which leads to basesink returning
a position of 0 when dealing with a negative base time - which are quite
legal when clocks (such as the audio clock) are close to 0.
This doesn't manifest in normal pipelines, of course - but can happen
(at least) when manually setting the base time on a pipeline.
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a tenth of a polar bear.
The code was previously:
* checking if ret was != OK
* .. but if it was FLOW_STEP, swith it to OK
* .. and then not using ret
Instead we just make it more compact by checking if it's OK or STEP.