mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
gst/pipewiresink: fix dts_offset
GStreamer uses a time stamp for the decoding time, but PipeWire uses an offset to the presentation time. Thus, the pipewiresink must not use the DTS as dts_offset, but has to calculate the offset. If the buffer's DTS is invalid, assume that dts is pts.
This commit is contained in:
parent
917c6419b1
commit
16964b323f
1 changed files with 4 additions and 1 deletions
|
|
@ -466,7 +466,10 @@ do_send_buffer (GstPipeWireSink *pwsink, GstBuffer *buffer)
|
||||||
if (data->header) {
|
if (data->header) {
|
||||||
data->header->seq = GST_BUFFER_OFFSET (buffer);
|
data->header->seq = GST_BUFFER_OFFSET (buffer);
|
||||||
data->header->pts = GST_BUFFER_PTS (buffer);
|
data->header->pts = GST_BUFFER_PTS (buffer);
|
||||||
data->header->dts_offset = GST_BUFFER_DTS (buffer);
|
if (GST_BUFFER_DTS(buffer) != GST_CLOCK_TIME_NONE)
|
||||||
|
data->header->dts_offset = GST_BUFFER_DTS (buffer) - GST_BUFFER_PTS (buffer);
|
||||||
|
else
|
||||||
|
data->header->dts_offset = 0;
|
||||||
}
|
}
|
||||||
if (data->crop) {
|
if (data->crop) {
|
||||||
GstVideoCropMeta *meta = gst_buffer_get_video_crop_meta (buffer);
|
GstVideoCropMeta *meta = gst_buffer_get_video_crop_meta (buffer);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue