mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 20:12:28 +00:00
basevideoenc: do not try to calculate latency from an unknown framerate
It'll divide by zero, and latency is unknown for an unknown framerate. Fixes an assert in the schroenc test. https://bugzilla.gnome.org/show_bug.cgi?id=657419
This commit is contained in:
parent
8e662fffb0
commit
f27ca88ecc
1 changed files with 4 additions and 0 deletions
|
@ -1168,6 +1168,10 @@ gst_base_video_encoder_set_latency_fields (GstBaseVideoEncoder *
|
||||||
{
|
{
|
||||||
gint64 latency;
|
gint64 latency;
|
||||||
|
|
||||||
|
/* 0 numerator is used for "don't know" */
|
||||||
|
if (GST_BASE_VIDEO_CODEC (base_video_encoder)->state.fps_n == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
latency = gst_util_uint64_scale (n_fields,
|
latency = gst_util_uint64_scale (n_fields,
|
||||||
GST_BASE_VIDEO_CODEC (base_video_encoder)->state.fps_d * GST_SECOND,
|
GST_BASE_VIDEO_CODEC (base_video_encoder)->state.fps_d * GST_SECOND,
|
||||||
2 * GST_BASE_VIDEO_CODEC (base_video_encoder)->state.fps_n);
|
2 * GST_BASE_VIDEO_CODEC (base_video_encoder)->state.fps_n);
|
||||||
|
|
Loading…
Reference in a new issue