]> git.sesse.net Git - mlt/commitdiff
Frame rate properites and factory initialisation
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 28 May 2005 13:46:29 +0000 (13:46 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 28 May 2005 13:46:29 +0000 (13:46 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@727 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c
src/framework/mlt_factory.c
src/framework/mlt_producer.c

index c6533555209b24a44f2dbf04ec0a551a4c11e3ff..e9c8a3420a5a8082bb21f541dcb9fc0114cccac9 100644 (file)
@@ -53,6 +53,8 @@ int mlt_consumer_init( mlt_consumer this, void *child )
                {
                        mlt_properties_set( properties, "normalisation", "PAL" );
                        mlt_properties_set_double( properties, "fps", 25.0 );
+                       mlt_properties_set_int( properties, "frame_rate_den", 25 );
+                       mlt_properties_set_int( properties, "frame_rate_num", 1 );
                        mlt_properties_set_int( properties, "width", 720 );
                        mlt_properties_set_int( properties, "height", 576 );
                        mlt_properties_set_int( properties, "progressive", 0 );
@@ -62,6 +64,8 @@ int mlt_consumer_init( mlt_consumer this, void *child )
                {
                        mlt_properties_set( properties, "normalisation", "NTSC" );
                        mlt_properties_set_double( properties, "fps", 30000.0 / 1001.0 );
+                       mlt_properties_set_int( properties, "frame_rate_den", 30000 );
+                       mlt_properties_set_int( properties, "frame_rate_num", 1001 );
                        mlt_properties_set_int( properties, "width", 720 );
                        mlt_properties_set_int( properties, "height", 480 );
                        mlt_properties_set_int( properties, "progressive", 0 );
index 1272a8e794400fef5fffab95d8230a04d1ea704e..3045e968b96d4b9fddd333172e5d82299975a232 100644 (file)
@@ -90,10 +90,6 @@ int mlt_factory_init( const char *prefix )
 
                // Create the global properties
                global_properties = mlt_properties_new( );
-               mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" );
-               mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" );
-               mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" );
-               mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) );
 
                // Create the object list.
                object_list = mlt_properties_new( );
@@ -108,6 +104,15 @@ int mlt_factory_init( const char *prefix )
                atexit( mlt_factory_close );
        }
 
+       // Allow property refresh on a subsequent initialisation
+       if ( global_properties != NULL )
+       {
+               mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" );
+               mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" );
+               mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" );
+               mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) );
+       }
+
        return 0;
 }
 
index d6c27e3c146b7bdd16b0f3b106ebf926ea086944..4963baa22ae9e584c99d85bf8079f7c278ae27c2 100644 (file)
@@ -89,11 +89,15 @@ int mlt_producer_init( mlt_producer this, void *child )
                        if ( normalisation == NULL || strcmp( normalisation, "NTSC" ) )
                        {
                                mlt_properties_set_double( properties, "fps", 25.0 );
+                               mlt_properties_set_int( properties, "frame_rate_den", 25 );
+                               mlt_properties_set_int( properties, "frame_rate_num", 1 );
                                mlt_properties_set_double( properties, "aspect_ratio", 59.0 / 54.0 );
                        }
                        else
                        {
                                mlt_properties_set_double( properties, "fps", 30000.0 / 1001.0 );
+                               mlt_properties_set_int( properties, "frame_rate_den", 30000 );
+                               mlt_properties_set_int( properties, "frame_rate_num", 1001 );
                                mlt_properties_set_double( properties, "aspect_ratio", 10.0 / 11.0 );
                        }
                        mlt_properties_set_double( properties, "_speed", 1.0 );