From 2b63a88f26bdaa7bc9ade594f9f80e20f3b6afe2 Mon Sep 17 00:00:00 2001 From: Joe Gorse Date: Thu, 25 Feb 2016 11:34:40 +0200 Subject: [PATCH] avfvideosrc: Frame durations as CTime to the API, not double Newer iOS seems to automatically convert, older iOS/OSX just crashes. https://bugzilla.gnome.org/show_bug.cgi?id=762575 --- sys/applemedia/avfvideosrc.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m index 1c8f633..529bd85 100644 --- a/sys/applemedia/avfvideosrc.m +++ b/sys/applemedia/avfvideosrc.m @@ -535,10 +535,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer */ frame_duration_value = [rate valueForKey:@"minFrameDuration"]; } else { - double frame_duration; - - gst_util_fraction_to_double (info->fps_d, info->fps_n, &frame_duration); - frame_duration_value = [NSNumber numberWithDouble:frame_duration]; + // Invert fps_n and fps_d to get frame duration value and timescale (or numerator and denominator) + frame_duration_value = [NSValue valueWithCMTime:CMTimeMake (info->fps_d, info->fps_n)]; } [device setValue:frame_duration_value forKey:@"activeVideoMinFrameDuration"]; @try { -- 2.7.4