diff options
author | Nicola Murino <nicola.murino@gmail.com> | 2017-08-09 11:26:37 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-08-09 12:38:05 +0300 |
commit | f5d8304724141834baf1e195d99ec32056f54d7c (patch) | |
tree | b37c84761f6ca68f8bb5965fa318f940b629e578 | |
parent | 27c04cf912502e7b9ae5635b56d4349696a02f43 (diff) |
vtenc: assume 25 fps for unknown framerate
This is better than reporting no latency at
all and then later failing in live pipelines.
https://bugzilla.gnome.org/show_bug.cgi?id=786036
-rw-r--r-- | sys/applemedia/vtenc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c index cef8f80b60..03ce865f39 100644 --- a/sys/applemedia/vtenc.c +++ b/sys/applemedia/vtenc.c @@ -1054,8 +1054,15 @@ gst_vtenc_update_latency (GstVTEnc * self) CFNumberGetValue (value, kCFNumberSInt32Type, &frames); if (self->latency_frames == -1 || self->latency_frames != frames) { self->latency_frames = frames; - frame_duration = gst_util_uint64_scale (GST_SECOND, - self->video_info.fps_d, self->video_info.fps_n); + if (self->video_info.fps_d == 0 || self->video_info.fps_n == 0) { + /* FIXME: Assume 25fps. This is better than reporting no latency at + * all and then later failing in live pipelines + */ + frame_duration = gst_util_uint64_scale (GST_SECOND, 1, 25); + } else { + frame_duration = gst_util_uint64_scale (GST_SECOND, + self->video_info.fps_d, self->video_info.fps_n); + } latency = frame_duration * frames; GST_INFO_OBJECT (self, "latency status %d frames %d fps %d/%d time %" GST_TIME_FORMAT, status, |