mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 22:05:58 +00:00
avvidec: Don't set bogus latency
We might have cases where the framerate is not known (0/1).
This commit is contained in:
parent
878d32ad38
commit
e36fa30c15
1 changed files with 7 additions and 5 deletions
|
@ -1095,11 +1095,13 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec,
|
|||
goto negotiate_failed;
|
||||
|
||||
/* The decoder is configured, we now know the true latency */
|
||||
latency =
|
||||
gst_util_uint64_scale_ceil (ffmpegdec->context->has_b_frames * GST_SECOND,
|
||||
fps_d, fps_n);
|
||||
gst_video_decoder_set_latency (GST_VIDEO_DECODER (ffmpegdec), latency,
|
||||
latency);
|
||||
if (fps_n) {
|
||||
latency =
|
||||
gst_util_uint64_scale_ceil (ffmpegdec->context->has_b_frames *
|
||||
GST_SECOND, fps_d, fps_n);
|
||||
gst_video_decoder_set_latency (GST_VIDEO_DECODER (ffmpegdec), latency,
|
||||
latency);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue