]> git.sesse.net Git - mlt/commitdiff
Switch to indexed propery names for frei0r params.
authorDan Dennedy <dan@dennedy.org>
Sun, 17 Mar 2013 20:15:23 +0000 (13:15 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 17 Mar 2013 20:15:23 +0000 (13:15 -0700)
Properties supplied by frei0r param name are supported for backwards
compatibility.

src/modules/frei0r/factory.c
src/modules/frei0r/frei0r_helper.c

index ea745c4087066b647c2da86468c803347aaa0d78..30f593e13df8772af24d00e60d6026942abc7ebd 100644 (file)
@@ -167,7 +167,7 @@ static mlt_properties fill_param_info ( mlt_service_type type, const char *servi
                mlt_properties_set_data ( parameter , string , pnum , 0 , ( mlt_destructor )mlt_properties_close, NULL );
                f0r_param_info_t paraminfo;
                param_info(&paraminfo,j);
-               mlt_properties_set ( pnum , "identifier" , paraminfo.name );
+               mlt_properties_set ( pnum , "identifier" , string );
                mlt_properties_set ( pnum , "title" , paraminfo.name );
                mlt_properties_set ( pnum , "description" , paraminfo.explanation);
                if ( paraminfo.type == F0R_PARAM_DOUBLE ){
index ca6b6a628f4da00fd02b9a5728d7ac4107ba84ef..fdb74c41a1701f620797952a4b576fdb491e117f 100644 (file)
@@ -89,12 +89,16 @@ int process_frei0r_item( mlt_service service, double position, double time, mlt_
                for (i=0;i<info.num_params;i++){
                        f0r_param_info_t pinfo;
                        f0r_get_param_info(&pinfo,i);
-                       if (mlt_properties_get( prop , pinfo.name ) !=NULL ){
+                       char index[20];
+                       snprintf( index, sizeof(index), "%d", i );
+                       char *val = mlt_properties_get( prop , index );
+                       if ( !val )
+                               val = mlt_properties_get( prop , pinfo.name );
+                       if ( val ) {
                                switch (pinfo.type) {
                                        case F0R_PARAM_DOUBLE:
                                        case F0R_PARAM_BOOL:
                                        {
-                                               char *val=mlt_properties_get(prop, pinfo.name );
                                                mlt_geometry geom=mlt_geometry_init();
                                                struct mlt_geometry_item_s item;
                                                mlt_geometry_parse(geom,val,-1,-1,-1);
@@ -107,14 +111,15 @@ int process_frei0r_item( mlt_service service, double position, double time, mlt_
                                        case F0R_PARAM_COLOR:
                                        {
                                                f0r_param_color_t color;
-                                               parse_color(mlt_properties_get_int(prop , pinfo.name), &color);
+                                               int int_color = mlt_properties_get(prop, index) ?
+                                                       mlt_properties_get_int(prop, index) : mlt_properties_get_int(prop, pinfo.name);
+                                               parse_color(int_color, &color);
                                                f0r_set_param_value(inst, &color, i);
                                                break;
                                        }
                                        case F0R_PARAM_STRING:
                                        {
-                                               f0r_param_string val = mlt_properties_get(prop, pinfo.name);
-                                               if (val) f0r_set_param_value(inst, &val, i);
+                                               f0r_set_param_value(inst, &val, i);
                                                break;
                                        }
                                }