X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fframework%2Fmlt_properties.c;h=4f691e1d03b96230853924b2258efc7135a942ec;hb=c9e76a22200def0d71eeb9dbc3963cfe49143f26;hp=c381e239a0828a97ed3bbe94ecb74f9f4043d186;hpb=b17e3e9f4eadc0dc53ded8a14df2059bb642afb1;p=mlt diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index c381e239..4f691e1d 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -871,8 +871,11 @@ int mlt_properties_parse( mlt_properties self, const char *namevalue ) int mlt_properties_get_int( mlt_properties self, const char *name ) { + mlt_profile profile = mlt_properties_get_data( self, "_profile", NULL ); + double fps = mlt_profile_fps( profile ); + property_list *list = self->local; mlt_property value = mlt_properties_find( self, name ); - return value == NULL ? 0 : mlt_property_get_int( value ); + return value == NULL ? 0 : mlt_property_get_int( value, fps, list->locale ); } /** Set a property to an integer value. @@ -955,9 +958,11 @@ int mlt_properties_set_int64( mlt_properties self, const char *name, int64_t val double mlt_properties_get_double( mlt_properties self, const char *name ) { + mlt_profile profile = mlt_properties_get_data( self, "_profile", NULL ); + double fps = mlt_profile_fps( profile ); mlt_property value = mlt_properties_find( self, name ); property_list *list = self->local; - return value == NULL ? 0 : mlt_property_get_double_l( value, list->locale ); + return value == NULL ? 0 : mlt_property_get_double( value, fps, list->locale ); } /** Set a property to a floating point value. @@ -998,8 +1003,11 @@ int mlt_properties_set_double( mlt_properties self, const char *name, double val mlt_position mlt_properties_get_position( mlt_properties self, const char *name ) { + mlt_profile profile = mlt_properties_get_data( self, "_profile", NULL ); + double fps = mlt_profile_fps( profile ); + property_list *list = self->local; mlt_property value = mlt_properties_find( self, name ); - return value == NULL ? 0 : mlt_property_get_position( value ); + return value == NULL ? 0 : mlt_property_get_position( value, fps, list->locale ); } /** Set a property to a position value. @@ -1952,3 +1960,26 @@ void mlt_properties_unlock( mlt_properties self ) if ( self ) pthread_mutex_unlock( &( ( property_list* )( self->local ) )->mutex ); } + +/** Get a time string associated to the name. + * + * Do not free the returned string. It's lifetime is controlled by the property. + * \public \memberof mlt_properties_s + * \param self a properties list + * \param name the property to get + * \param format the time format that you want + * \return the property's time value or NULL if \p name does not exist or there is no profile + */ + +char *mlt_properties_get_time( mlt_properties self, const char* name, mlt_time_format format ) +{ + mlt_profile profile = mlt_properties_get_data( self, "_profile", NULL ); + if ( profile ) + { + double fps = mlt_profile_fps( profile ); + mlt_property value = mlt_properties_find( self, name ); + property_list *list = self->local; + return value == NULL ? NULL : mlt_property_get_time( value, format, fps, list->locale ); + } + return NULL; +}