From 3531bc485623608b5ecc6e780710251d32d6161c Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Wed, 24 Mar 2004 17:19:48 +0000 Subject: [PATCH] track reversal and hidden tracks git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@238 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/framework/mlt_frame.c | 2 +- src/framework/mlt_multitrack.c | 1 + src/framework/mlt_producer.c | 2 ++ src/framework/mlt_tractor.c | 4 ++-- src/framework/mlt_transition.c | 4 ++++ src/modules/inigo/producer_inigo.c | 15 ++++++++++++++- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 360ecb0..ce820b9 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -88,7 +88,7 @@ mlt_properties mlt_frame_properties( mlt_frame this ) int mlt_frame_is_test_card( mlt_frame this ) { - return mlt_properties_get_int( mlt_frame_properties( this ), "test_image" ); + return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( mlt_frame_properties( this ), "test_image" ); } /** Check if we have a way to derive something than test audio. diff --git a/src/framework/mlt_multitrack.c b/src/framework/mlt_multitrack.c index 323d1ee..84f2389 100644 --- a/src/framework/mlt_multitrack.c +++ b/src/framework/mlt_multitrack.c @@ -374,6 +374,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind 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_int( properties, "hide", mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) ); } else { diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 74441f9..a35d134 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -298,6 +298,8 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind mlt_properties_set_double( properties, "fps", mlt_producer_get_fps( this ) ); double speed = mlt_producer_get_speed( this ); mlt_properties_set_double( properties, "_speed", speed ); + mlt_properties_set_int( properties, "test_audio", mlt_frame_is_test_audio( *frame ) ); + mlt_properties_set_int( properties, "test_image", mlt_frame_is_test_card( *frame ) ); return 0; } diff --git a/src/framework/mlt_tractor.c b/src/framework/mlt_tractor.c index 16c7c50..783cf55 100644 --- a/src/framework/mlt_tractor.c +++ b/src/framework/mlt_tractor.c @@ -199,9 +199,9 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra mlt_properties_set_data( frame_properties, label, temp, 0, ( mlt_destructor )mlt_frame_close, NULL ); // Pick up first video and audio frames - if ( audio == NULL && !mlt_frame_is_test_audio( temp ) ) + if ( !done && !mlt_frame_is_test_audio( temp ) && !( mlt_properties_get_int( mlt_frame_properties( temp ), "hide" ) & 2 ) ) audio = temp; - if ( video == NULL && !mlt_frame_is_test_card( temp ) ) + if ( !done && !mlt_frame_is_test_card( temp ) && !( mlt_properties_get_int( mlt_frame_properties( temp ), "hide" ) & 1 ) ) video = temp; } diff --git a/src/framework/mlt_transition.c b/src/framework/mlt_transition.c index 12443d7..7d4bc41 100644 --- a/src/framework/mlt_transition.c +++ b/src/framework/mlt_transition.c @@ -197,6 +197,10 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i { // Process the transition *frame = mlt_transition_process( this, this->a_frame, this->b_frame ); + if ( !mlt_properties_get_int( mlt_frame_properties( this->a_frame ), "test_image" ) ) + mlt_properties_set_int( mlt_frame_properties( this->b_frame ), "test_image", 1 ); + if ( !mlt_properties_get_int( mlt_frame_properties( this->a_frame ), "test_audio" ) ) + mlt_properties_set_int( mlt_frame_properties( this->b_frame ), "test_audio", 1 ); this->a_held = 0; } else diff --git a/src/modules/inigo/producer_inigo.c b/src/modules/inigo/producer_inigo.c index 8e1b1c8..1e6b4bb 100644 --- a/src/modules/inigo/producer_inigo.c +++ b/src/modules/inigo/producer_inigo.c @@ -158,7 +158,10 @@ mlt_producer producer_inigo_init( char **argv ) producer = NULL; mlt_playlist_blank( playlist, atof( argv[ ++ i ] ) ); } - else if ( !strcmp( argv[ i ], "-track" ) ) + else if ( !strcmp( argv[ i ], "-track" ) || + !strcmp( argv[ i ], "-hide-track" ) || + !strcmp( argv[ i ], "-hide-video" ) || + !strcmp( argv[ i ], "-hide-audio" ) ) { if ( producer != NULL ) mlt_playlist_append( playlist, producer ); @@ -166,6 +169,16 @@ mlt_producer producer_inigo_init( char **argv ) mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ++ ); track_service( field, playlist, ( mlt_destructor )mlt_playlist_close ); playlist = mlt_playlist_init( ); + if ( playlist != NULL ) + { + properties = mlt_playlist_properties( playlist ); + if ( !strcmp( argv[ i ], "-hide-track" ) ) + mlt_properties_set_int( properties, "hide", 3 ); + else if ( !strcmp( argv[ i ], "-hide-video" ) ) + mlt_properties_set_int( properties, "hide", 1 ); + else if ( !strcmp( argv[ i ], "-hide-audio" ) ) + mlt_properties_set_int( properties, "hide", 2 ); + } } else if ( strchr( argv[ i ], '=' ) ) { -- 1.7.4.4