// If none is specified, pick up the default for this normalisation
if ( profile == NULL )
- sprintf( temp, "%s/feeds/%s/data_fx.properties", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ) );
+ sprintf( temp, "%s/feeds/%s/data_fx.properties", mlt_environment( "MLT_DATA" ), mlt_environment( "MLT_NORMALISATION" ) );
else if ( strchr( profile, '%' ) )
- sprintf( temp, "%s/feeds/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( profile, '%' ) + 1 );
+ sprintf( temp, "%s/feeds/%s/%s", mlt_environment( "MLT_DATA" ), mlt_environment( "MLT_NORMALISATION" ), strchr( profile, '%' ) + 1 );
else
strcpy( temp, profile );
/** Convert frames to Timecode
*/
-char* frame_to_timecode( int frames , int fps)
+char* frame_to_timecode( int frames, double fps)
{
if (fps == 0) return strdup("-");
char *res = malloc(12);
- int seconds = frames / (int) fps;
- frames = frames % ((int) fps);
+ int seconds = frames / fps;
+ frames = frames % lrint( fps );
int minutes = seconds / 60;
seconds = seconds % 60;
int hours = minutes / 60;
{
int i = 0;
mlt_properties properties = MLT_FILTER_PROPERTIES( requested );
- static char *prefix = "properties.";
+ static const char *prefix = "properties.";
int len = strlen( prefix );
// Determine if this is an absolute or relative feed
{
// special case: replace #timecode# with current frame timecode
int pos = mlt_properties_get_int( feed, "position" );
- char *tc = frame_to_timecode( pos, mlt_profile_fps( NULL ) );
+ char *tc = frame_to_timecode( pos, mlt_profile_fps( mlt_service_profile( MLT_FILTER_SERVICE( filter ) ) ) );
strcat( result, tc );
free( tc );
}
+ else if ( !strcmp( keywords, "frame" ) )
+ {
+ // special case: replace #frame# with current frame number
+ int pos = mlt_properties_get_int( feed, "position" );
+ char s[12];
+ snprintf( s, sizeof(s) - 1, "%d", pos );
+ strcat( result, s );
+ }
else
{
// replace keyword with metadata value