mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-02 12:45:51 +00:00
basesink: use dts and pts for sync
First use DTS, then fall back to PTS for synchronization.
This commit is contained in:
parent
e1b64d971e
commit
543b56c78f
|
@ -3031,9 +3031,12 @@ gst_base_sink_default_get_times (GstBaseSink * basesink, GstBuffer * buffer,
|
||||||
{
|
{
|
||||||
GstClockTime timestamp, duration;
|
GstClockTime timestamp, duration;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
/* first sync on DTS, else use PTS */
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
timestamp = GST_BUFFER_DTS (buffer);
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (timestamp))
|
||||||
|
timestamp = GST_BUFFER_PTS (buffer);
|
||||||
|
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
/* get duration to calculate end time */
|
/* get duration to calculate end time */
|
||||||
duration = GST_BUFFER_DURATION (buffer);
|
duration = GST_BUFFER_DURATION (buffer);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (duration)) {
|
if (GST_CLOCK_TIME_IS_VALID (duration)) {
|
||||||
|
|
Loading…
Reference in a new issue