mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
gst/src: Set buffer duration
We compute this from the clock quantum for audio and the negotiated framerate for video. Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1438
This commit is contained in:
parent
2f9a5e0694
commit
3cc5ca5a91
1 changed files with 9 additions and 0 deletions
|
|
@ -603,6 +603,15 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
GST_BUFFER_PTS (buf) = b->time - pwsrc->delay;
|
||||
GST_BUFFER_DTS (buf) = b->time - pwsrc->delay;
|
||||
}
|
||||
|
||||
if (pwsrc->is_video) {
|
||||
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
||||
pwsrc->video_info.fps_d, pwsrc->video_info.fps_n);
|
||||
} else {
|
||||
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
||||
time.size * time.rate.num, time.rate.denom);
|
||||
}
|
||||
|
||||
crop = data->crop;
|
||||
if (crop) {
|
||||
GstVideoCropMeta *meta = gst_buffer_get_video_crop_meta(buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue