20.09.14 22:10, Dan Dennedy написав(ла):
On Thu, Sep 18, 2014 at 9:29 AM, Maksym Veremeyenko <ve...@m1stereo.tv
<mailto:ve...@m1stereo.tv>> wrote:

    Hi,

    in some cases default producer length 15000 is not enough, but
    changing it to other big value could break other product that uses
    mltframework. attached patch makes possible to override this value
    throw environment variable.


I just did some tests using previous patch that defaults it INT_MAX, and
it is causing problems in existing applications. Every app would need to
make a few changes in a few places to deal with each type of producer -
images, frei0r generators, etc. So, the environment variable seems more
sensible for now.

diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c
index a45d52b..25a3f8d 100644
--- a/src/framework/mlt_producer.c
+++ b/src/framework/mlt_producer.c
@@ -93,8 +93,10 @@ int mlt_producer_init( mlt_producer self, void *child )
mlt_properties_set_double( properties, "_frame", 0 );
mlt_properties_set_double( properties, "_speed", 1.0 );
mlt_properties_set_position( properties, "in", 0 );
-mlt_properties_set_position( properties, "out", 14999 );
-mlt_properties_set_position( properties, "length", 15000 );
+char *e = getenv("MLT_DEFAULT_PRODUCER_LENGTH");
+int p = (e)?atol(e):15000;

Why atol (long) instead of atoi (int)? Using our preferred spacing:
int p = e ? atoi( e ) : 15000;
updated patch attached


--
________________________________________
Maksym Veremeyenko
>From bffafb8d56477c56e529b34a76d3d38311e7d40c Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Mon, 22 Sep 2014 12:46:10 +0300
Subject: [PATCH 2/2] introduce MLT_DEFAULT_PRODUCER_LENGTH env var to
 override default hardcoded value

---
 src/framework/mlt_producer.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c
index a45d52b..0b6335d 100644
--- a/src/framework/mlt_producer.c
+++ b/src/framework/mlt_producer.c
@@ -93,8 +93,10 @@ int mlt_producer_init( mlt_producer self, void *child )
 			mlt_properties_set_double( properties, "_frame", 0 );
 			mlt_properties_set_double( properties, "_speed", 1.0 );
 			mlt_properties_set_position( properties, "in", 0 );
-			mlt_properties_set_position( properties, "out", 14999 );
-			mlt_properties_set_position( properties, "length", 15000 );
+			char *e = getenv( "MLT_DEFAULT_PRODUCER_LENGTH" );
+			int p = e ? atoi( e ) : 15000;
+			mlt_properties_set_position( properties, "out", p - 1 );
+			mlt_properties_set_position( properties, "length", p );
 			mlt_properties_set( properties, "eof", "pause" );
 			mlt_properties_set( properties, "resource", "<producer>" );
 
-- 
1.7.7.6

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to