mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
gst/src: Check for 0 framerate before setting duration
This is possible if the source doesn't provide the framerate (as is the case for libcamera), or if the framerate is variable (0/1).
This commit is contained in:
parent
169e5ecd4b
commit
1e3797512a
1 changed files with 4 additions and 2 deletions
|
|
@ -605,8 +605,10 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
}
|
||||
|
||||
if (pwsrc->is_video) {
|
||||
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
||||
pwsrc->video_info.fps_d, pwsrc->video_info.fps_n);
|
||||
if (pwsrc->video_info.fps_n) {
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue