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
473e71e1ca
commit
8a044de701
@ -1025,6 +1025,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…
x
Reference in New Issue
Block a user