mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
gst: fix the timestamping
We want to store the absolute time against some clock in the message timestamp.
This commit is contained in:
parent
9425a2bd2f
commit
1b74396562
3 changed files with 33 additions and 8 deletions
|
|
@ -297,16 +297,26 @@ gst_pinos_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
PinosBufferInfo info;
|
||||
GSocketControlMessage *mesg;
|
||||
GstMemory *mem = NULL;
|
||||
GstClockTime pts, dts, base;
|
||||
|
||||
pinossink = GST_PINOS_SINK (bsink);
|
||||
|
||||
if (!pinossink->negotiated)
|
||||
goto not_negotiated;
|
||||
|
||||
base = GST_ELEMENT_CAST (bsink)->base_time;
|
||||
|
||||
pts = GST_BUFFER_PTS (buffer);
|
||||
dts = GST_BUFFER_DTS (buffer);
|
||||
if (!GST_CLOCK_TIME_IS_VALID (pts))
|
||||
pts = dts;
|
||||
else if (!GST_CLOCK_TIME_IS_VALID (dts))
|
||||
dts = pts;
|
||||
|
||||
info.flags = 0;
|
||||
info.seq = 0;
|
||||
info.pts = GST_BUFFER_TIMESTAMP (buffer);
|
||||
info.dts_offset = 0;
|
||||
info.seq = GST_BUFFER_OFFSET (buffer);
|
||||
info.pts = GST_CLOCK_TIME_IS_VALID (pts) ? pts + base : base;
|
||||
info.dts_offset = GST_CLOCK_TIME_IS_VALID (dts) && GST_CLOCK_TIME_IS_VALID (pts) ? pts - dts : 0;
|
||||
info.offset = 0;
|
||||
info.size = gst_buffer_get_size (buffer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue