if ( get_image != NULL )
{
+ mlt_properties_set_int( properties, "image_count", mlt_properties_get_int( properties, "image_count" ) - 1 );
mlt_position position = mlt_frame_get_position( this );
error = get_image( this, buffer, format, width, height, writable );
mlt_frame_set_position( this, position );
mlt_properties_set_int( properties, "width", *width );
mlt_properties_set_int( properties, "height", *height );
- mlt_properties_set_int( properties, "aspect_ratio", 1 );
+ mlt_properties_set_int( properties, "aspect_ratio", 0 );
switch( *format )
{
int i, j;
double d = 0, s = 0;
- mlt_frame_get_audio( this, &dest, format, &frequency_dest, &channels_dest, &samples_dest );
mlt_frame_get_audio( that, &src, format, &frequency_src, &channels_src, &samples_src );
+ mlt_frame_get_audio( this, &dest, format, &frequency_dest, &channels_dest, &samples_dest );
int silent = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "silent_audio" );
mlt_properties_set_int( MLT_FRAME_PROPERTIES( this ), "silent_audio", 0 );
return samples;
}
+
+int64_t mlt_sample_calculator_to_now( float fps, int frequency, int64_t frame )
+{
+ int64_t samples = 0;
+
+ // TODO: Correct rules for NTSC and drop the * 100 hack
+ if ( ( int )( fps * 100 ) == 2997 )
+ {
+ samples = ( ( double )( frame * frequency ) / 30 );
+ switch( frequency )
+ {
+ case 48000:
+ samples += 2 * ( frame / 5 );
+ break;
+ case 44100:
+ samples += frame + ( frame / 2 ) - ( frame / 30 ) + ( frame / 300 );
+ break;
+ case 32000:
+ samples += ( 2 * frame ) - ( frame / 4 ) - ( frame / 29 );
+ break;
+ }
+ }
+ else if ( fps != 0 )
+ {
+ samples = ( ( frame * frequency ) / ( int )fps );
+ }
+
+ return samples;
+}