mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-18 14:32:58 -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) {
|
if (pwsrc->is_video) {
|
||||||
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
if (pwsrc->video_info.fps_n) {
|
||||||
pwsrc->video_info.fps_d, 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 {
|
} else {
|
||||||
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
GST_BUFFER_DURATION (buf) = gst_util_uint64_scale (GST_SECOND,
|
||||||
time.size * time.rate.num, time.rate.denom);
|
time.size * time.rate.num, time.rate.denom);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue