On Thu, Sep 18, 2014 at 9:29 AM, Maksym Veremeyenko <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;

+ 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>" );
------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&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