int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
mlt_properties properties = mlt_frame_properties( this );
+ int hide = mlt_properties_get_int( properties, "test_audio" );
- if ( this->get_audio != NULL )
+ if ( hide == 0 && this->get_audio != NULL )
{
this->get_audio( this, buffer, format, frequency, channels, samples );
}
// Get the producer for this track
mlt_producer producer = this->list[ index ]->producer;
+ // Get the track hide property
+ int hide = mlt_properties_get_int( mlt_producer_properties( mlt_producer_cut_parent( producer ) ), "hide" );
+
// Obtain the current position
mlt_position position = mlt_producer_frame( parent );
+ // Get the parent properties
+ mlt_properties producer_properties = mlt_producer_properties( parent );
+
+ // Get the speed
+ double speed = mlt_properties_get_double( producer_properties, "_speed" );
+
// Make sure we're at the same point
mlt_producer_seek( producer, position );
mlt_service_get_frame( mlt_producer_service( producer ), frame, 0 );
// Indicate speed of this producer
- mlt_properties producer_properties = mlt_producer_properties( parent );
- double speed = mlt_properties_get_double( producer_properties, "_speed" );
mlt_properties properties = mlt_frame_properties( *frame );
mlt_properties_set_double( properties, "_speed", speed );
mlt_properties_set_position( properties, "_position", position );
- mlt_properties_set_int( properties, "hide", mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) );
+ if ( mlt_properties_get_int( properties, "test_image" ) == 0 )
+ mlt_properties_set_int( properties, "test_image", hide & 1 );
+ if ( mlt_properties_get_int( properties, "test_audio" ) == 0 )
+ mlt_properties_set_int( properties, "test_audio", hide & 2 );
}
else
{
/** Seek in the virtual playlist.
*/
-static mlt_service mlt_playlist_virtual_seek( mlt_playlist this )
+static mlt_service mlt_playlist_virtual_seek( mlt_playlist this, int *progressive )
{
// Default producer to blank
mlt_producer producer = NULL;
if ( producer != NULL )
{
int count = this->list[ i ]->frame_count / this->list[ i ]->repeat;
+ *progressive = count == 1;
mlt_producer_seek( producer, position % count );
}
else if ( !strcmp( eof, "pause" ) && total > 0 )
{
playlist_entry *entry = this->list[ this->count - 1 ];
+ int count = entry->frame_count / entry->repeat;
mlt_producer this_producer = mlt_playlist_producer( this );
mlt_producer_seek( this_producer, original - 1 );
producer = entry->producer;
- mlt_producer_seek( producer, entry->frame_out );
+ mlt_producer_seek( producer, entry->frame_out % count );
mlt_producer_set_speed( this_producer, 0 );
mlt_producer_set_speed( producer, 0 );
+ *progressive = count == 1;
}
else if ( !strcmp( eof, "loop" ) && total > 0 )
{
playlist_entry *entry = this->list[ clip ];
mlt_playlist_append( new_clip, entry->producer );
mlt_playlist_repeat_clip( new_clip, i, entry->repeat );
- if ( entry->frame_count == entry->repeat )
- mlt_properties_set_int( mlt_playlist_properties( new_clip ), "hide", 2 );
entry->preservation_hack = 1;
mlt_playlist_remove( this, clip );
}
}
mlt_events_unblock( mlt_playlist_properties( this ), this );
- mlt_events_fire( mlt_playlist_properties( this ), "producer-changed", NULL );
+ mlt_playlist_virtual_refresh( this );
mlt_producer_close( track_a );
mlt_producer_close( track_b );
mlt_tractor_close( tractor );
{
mlt_producer producer = mlt_producer_cut_parent( this->list[ clip ]->producer );
mlt_properties properties = mlt_producer_properties( producer );
- error = mlt_properties_get_data( properties, "mlt_mix", NULL ) == NULL;
+ error = mlt_properties_get_data( properties, "mlt_mix", NULL ) == NULL ||
+ this->list[ clip ]->preservation_hack;
}
if ( error == 0 )
// Get this mlt_playlist
mlt_playlist this = producer->child;
+ // Need to ensure the frame is deinterlaced when repeating 1 frame
+ int progressive = 0;
+
// Get the real producer
- mlt_service real = mlt_playlist_virtual_seek( this );
+ mlt_service real = mlt_playlist_virtual_seek( this, &progressive );
// Get the frame
mlt_service_get_frame( real, frame, index );
if ( mlt_properties_get_int( properties, "end_of_clip" ) )
mlt_playlist_virtual_set_out( this );
+ // Set the consumer progressive property
+ if ( progressive )
+ {
+ mlt_properties_set_int( properties, "consumer_progressive", progressive );
+ mlt_properties_set_int( properties, "test_audio", 1 );
+ }
+
// Check for notifier and call with appropriate argument
mlt_properties playlist_properties = mlt_producer_properties( producer );
void ( *notifier )( void * ) = mlt_properties_get_data( playlist_properties, "notifier", NULL );
data_queue = mlt_properties_get_data( mlt_frame_properties( temp ), "data_queue", NULL );
// Pick up first video and audio frames
- if ( !done && !mlt_frame_is_test_audio( temp ) && !( mlt_properties_get_int( mlt_frame_properties( temp ), "hide" ) & 2 ) )
+ if ( !done && !mlt_frame_is_test_audio( temp ) )
audio = temp;
- if ( !done && !mlt_frame_is_test_card( temp ) && !( mlt_properties_get_int( mlt_frame_properties( temp ), "hide" ) & 1 ) )
+ if ( !done && !mlt_frame_is_test_card( temp ) )
video = temp;
}
// Now stack callbacks
if ( audio != NULL )
{
+ mlt_properties audio_properties = mlt_frame_properties( audio );
mlt_frame_push_audio( *frame, audio );
( *frame )->get_audio = producer_get_audio;
+ mlt_properties_set_position( frame_properties, "_position", mlt_properties_get_position( audio_properties, "_position" ) );
}
if ( video != NULL )
mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( video_properties, "width" ) );
mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( video_properties, "height" ) );
mlt_properties_set_double( frame_properties, "aspect_ratio", mlt_properties_get_double( video_properties, "aspect_ratio" ) );
+ mlt_properties_set_position( frame_properties, "_position", mlt_properties_get_position( video_properties, "_position" ) );
}
mlt_properties_set_int( mlt_frame_properties( *frame ), "test_audio", audio == NULL );
}
//fprintf( stderr, "transition_mix: previous %f current %f\n", mix_start, mix_end );
+ mlt_properties_set_int( b_props, "test_audio", mlt_properties_get_int( b_props, "original_test_audio" ) );
mlt_frame_mix_audio( frame, b_frame, mix_start, mix_end, buffer, format, frequency, channels, samples );
return 0;
mlt_properties_set_double( properties, "previous_mix", mlt_properties_get_double( b_props, "audio.mix" ) );
mlt_properties_set_double( b_props, "audio.reverse", mlt_properties_get_double( properties, "reverse" ) );
+
+ mlt_properties_set_int( b_props, "original_test_audio", mlt_properties_get_int( b_props, "test_audio" ) );
}
// Backup the original get_audio (it's still needed)