mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
nvdec: Fix division by zero when calculating buffer duration
Don't try to calculate buffer duration from variable framerate Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5764>
This commit is contained in:
parent
4ff2f07e51
commit
b168647073
1 changed files with 8 additions and 4 deletions
|
@ -805,10 +805,14 @@ parser_display_callback (GstNvDec * nvdec, CUVIDPARSERDISPINFO * dispinfo)
|
|||
GST_BUFFER_PTS (output_buffer) = dispinfo->timestamp;
|
||||
GST_BUFFER_DTS (output_buffer) = GST_CLOCK_TIME_NONE;
|
||||
/* assume buffer duration from framerate */
|
||||
GST_BUFFER_DURATION (output_buffer) =
|
||||
gst_util_uint64_scale (GST_SECOND,
|
||||
GST_VIDEO_INFO_FPS_D (&nvdec->out_info),
|
||||
GST_VIDEO_INFO_FPS_N (&nvdec->out_info));
|
||||
if (nvdec->out_info.fps_n > 0 && nvdec->out_info.fps_d > 0) {
|
||||
GST_BUFFER_DURATION (output_buffer) =
|
||||
gst_util_uint64_scale (GST_SECOND,
|
||||
GST_VIDEO_INFO_FPS_D (&nvdec->out_info),
|
||||
GST_VIDEO_INFO_FPS_N (&nvdec->out_info));
|
||||
} else {
|
||||
GST_BUFFER_DURATION (output_buffer) = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
} else {
|
||||
ret = gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (nvdec),
|
||||
frame);
|
||||
|
|
Loading…
Reference in a new issue