mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vtdec: Handle 0/1 framerates correctly by not calculating their frame duration
This commit is contained in:
parent
916155da2b
commit
e653068bc2
1 changed files with 10 additions and 2 deletions
|
@ -750,9 +750,17 @@ compute_h264_decode_picture_buffer_length (GstVtdec * vtdec,
|
|||
static void
|
||||
gst_vtdec_set_latency (GstVtdec * vtdec)
|
||||
{
|
||||
GstClockTime frame_duration = gst_util_uint64_scale (GST_SECOND,
|
||||
GstClockTime frame_duration;
|
||||
GstClockTime latency;
|
||||
|
||||
if (vtdec->video_info.fps_n == 0) {
|
||||
GST_INFO_OBJECT (vtdec, "Framerate not known, can't set latency");
|
||||
return;
|
||||
}
|
||||
|
||||
duration = gst_util_uint64_scale (GST_SECOND,
|
||||
vtdec->video_info.fps_d, vtdec->video_info.fps_n);
|
||||
GstClockTime latency = frame_duration * vtdec->reorder_queue_length;
|
||||
latency = frame_duration * vtdec->reorder_queue_length;
|
||||
|
||||
GST_INFO_OBJECT (vtdec, "setting latency frames:%d time:%" GST_TIME_FORMAT,
|
||||
vtdec->reorder_queue_length, GST_TIME_ARGS (latency));
|
||||
|
|
Loading…
Reference in a new issue