From 0400e23453f54b4a06333a69f42907e4894e5d2c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sun, 3 Sep 2023 15:20:25 +0200 Subject: [PATCH] On Chain init, don't unnecessarily fetch source frame --- src/framework/mlt_chain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/framework/mlt_chain.c b/src/framework/mlt_chain.c index f85693274..db70ca943 100644 --- a/src/framework/mlt_chain.c +++ b/src/framework/mlt_chain.c @@ -128,8 +128,10 @@ void mlt_chain_set_source(mlt_chain self, mlt_producer source) // Save the native source producer frame rate base->source_profile = mlt_profile_clone(mlt_service_profile(MLT_CHAIN_SERVICE(self))); mlt_frame frame = NULL; - mlt_service_get_frame(MLT_PRODUCER_SERVICE(source), &frame, 0); - mlt_frame_close(frame); + if (!mlt_properties_exists(source_properties, "meta.media.frame_rate_num") || !mlt_properties_exists(source_properties, "meta.media.frame_rate_den")) { + mlt_service_get_frame(MLT_PRODUCER_SERVICE(source), &frame, 0); + mlt_frame_close(frame); + } if (mlt_properties_get_int(source_properties, "meta.media.frame_rate_num") > 0 && mlt_properties_get_int(source_properties, "meta.media.frame_rate_den") > 0) { base->source_profile->frame_rate_num