mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +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
1 changed files with 5 additions and 2 deletions
|
@ -3031,9 +3031,12 @@ gst_base_sink_default_get_times (GstBaseSink * basesink, GstBuffer * buffer,
|
|||
{
|
||||
GstClockTime timestamp, duration;
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buffer);
|
||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||
/* first sync on DTS, else use PTS */
|
||||
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 */
|
||||
duration = GST_BUFFER_DURATION (buffer);
|
||||
if (GST_CLOCK_TIME_IS_VALID (duration)) {
|
||||
|
|
Loading…
Reference in a new issue