From: lilo_booter Date: Tue, 10 Feb 2004 13:58:21 +0000 (+0000) Subject: Miracle mods X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2d9ad7ff9d46ac8da7fb0d1d350febbe0c24317d;p=mlt Miracle mods git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@132 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/docs/testing-20040110.txt b/docs/testing-20040110.txt index a8ec9331..731f9e8f 100644 --- a/docs/testing-20040110.txt +++ b/docs/testing-20040110.txt @@ -20,15 +20,15 @@ XFER Incorrect Behaviour ------------------------------------------------------------------------------ -killall miracle does not work. requires killall -HUP -USTA when stopped reports "paused" CLEAN removes all clips (as opposed to leaving the currently playing one) -USET eof=pause is partially supported Different Intentional Behaviour ------------------------------------------------------------------------------ +Different forced Behaviour +------------------------------------------------------------------------------ +killall miracle does not work when the SDL consumer is in use. requires killall -HUP MLT Bugs ------------------------------------------------------------------------------ diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 7399d51c..4b022101 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -178,7 +178,7 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer this->list[ this->count ]->frame_out = out; this->list[ this->count ]->frame_count = out - in + 1; - mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" ); + mlt_properties_set( mlt_producer_properties( producer ), "eof", "pause" ); mlt_producer_set_speed( producer, 0 ); @@ -198,6 +198,8 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) // Map playlist position to real producer in virtual playlist mlt_position position = mlt_producer_frame( &this->parent ); + mlt_position original = position; + // Total number of frames int64_t total = 0; @@ -240,10 +242,11 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) { playlist_entry *entry = this->list[ this->count - 1 ]; mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek( this_producer, total - 1 - mlt_producer_get_in( this_producer ) ); + mlt_producer_seek( this_producer, original - 1 ); producer = entry->producer; mlt_producer_seek( producer, entry->frame_out ); mlt_producer_set_speed( this_producer, 0 ); + mlt_producer_set_speed( producer, 0 ); } else if ( !strcmp( eof, "loop" ) && total > 0 ) { diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 9ae6d798..3c953d62 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -104,9 +104,18 @@ int mlt_producer_seek( mlt_producer this, mlt_position position ) // Check bounds if ( position < 0 ) + { position = 0; + } else if ( !strcmp( eof, "pause" ) && position >= mlt_producer_get_playtime( this ) ) + { + mlt_producer_set_speed( this, 0 ); position = mlt_producer_get_playtime( this ) - 1; + } + else if ( !strcmp( eof, "loop" ) && position >= mlt_producer_get_playtime( this ) ) + { + position = position % mlt_producer_get_playtime( this ); + } // Set the position mlt_properties_set_position( mlt_producer_properties( this ), "_position", position ); diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index 27f4a27b..970fbd4a 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -79,12 +79,15 @@ mlt_properties mlt_properties_new( ) static void mlt_properties_do_mirror( mlt_properties this, char *name ) { - mlt_properties mirror = mlt_properties_get_data( this, "mlt_mirror", NULL ); - if ( mirror != NULL ) + if ( strcmp( name, "in" ) && strcmp( name, "out" ) ) { - char *value = mlt_properties_get( this, name ); - if ( value != NULL ) - mlt_properties_set( mirror, name, value ); + mlt_properties mirror = mlt_properties_get_data( this, "mlt_mirror", NULL ); + if ( mirror != NULL ) + { + char *value = mlt_properties_get( this, name ); + if ( value != NULL ) + mlt_properties_set( mirror, name, value ); + } } } diff --git a/src/miracle/miracle_unit.c b/src/miracle/miracle_unit.c index cacdc506..70037171 100644 --- a/src/miracle/miracle_unit.c +++ b/src/miracle/miracle_unit.c @@ -193,6 +193,7 @@ void miracle_unit_report_list( miracle_unit unit, valerie_response response ) { int i; mlt_properties properties = unit->properties; + char *root_dir = mlt_properties_get( properties, "root" ); int generation = mlt_properties_get_int( properties, "generation" ); mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); @@ -202,8 +203,11 @@ void miracle_unit_report_list( miracle_unit unit, valerie_response response ) { mlt_playlist_clip_info info; mlt_playlist_get_clip_info( playlist , &info, i ); + char *resource = info.resource; + if ( root_dir != NULL && !strncmp( resource, root_dir, strlen( root_dir ) ) ) + resource += strlen( root_dir ); valerie_response_printf( response, 10240, "%d \"%s\" %lld %lld %lld %lld %.2f\n", - i, info.resource, + i, resource, info.frame_in, info.frame_out, info.frame_count, @@ -389,6 +393,7 @@ int miracle_unit_get_status( miracle_unit unit, valerie_status status ) if ( !error ) { mlt_properties properties = unit->properties; + char *root_dir = mlt_properties_get( properties, "root" ); mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL ); mlt_producer producer = mlt_playlist_producer( playlist ); mlt_producer clip = mlt_playlist_current( playlist ); @@ -399,14 +404,20 @@ int miracle_unit_get_status( miracle_unit unit, valerie_status status ) if ( info.resource != NULL && strcmp( info.resource, "" ) ) { - strncpy( status->clip, info.resource, sizeof( status->clip ) ); + if ( root_dir == NULL || strncmp( info.resource, root_dir, strlen( root_dir ) ) ) + strncpy( status->clip, info.resource, sizeof( status->clip ) ); + else + strncpy( status->clip, info.resource + strlen( root_dir ), sizeof( status->clip ) ); status->speed = (int)( mlt_producer_get_speed( producer ) * 1000.0 ); status->fps = mlt_producer_get_fps( producer ); status->in = info.frame_in; status->out = info.frame_out; status->position = mlt_producer_position( clip ); status->length = mlt_producer_get_length( clip ); - strncpy( status->tail_clip, info.resource, sizeof( status->tail_clip ) ); + if ( root_dir == NULL || strncmp( info.resource, root_dir, strlen( root_dir ) ) ) + strncpy( status->tail_clip, info.resource, sizeof( status->tail_clip ) ); + else + strncpy( status->clip, info.resource + strlen( root_dir ), sizeof( status->clip ) ); status->tail_in = info.frame_in; status->tail_out = info.frame_out; status->tail_position = mlt_producer_position( clip ); diff --git a/src/valerie/valerie_notifier.c b/src/valerie/valerie_notifier.c index 5e374a85..9c446504 100644 --- a/src/valerie/valerie_notifier.c +++ b/src/valerie/valerie_notifier.c @@ -93,7 +93,9 @@ int valerie_notifier_wait( valerie_notifier this, valerie_status status ) } else { - error = -1; + pthread_mutex_lock( &this->mutex ); + valerie_status_copy( status, &this->last ); + pthread_mutex_unlock( &this->mutex ); } pthread_mutex_unlock( &this->cond_mutex ); diff --git a/src/valerie/valerie_status.h b/src/valerie/valerie_status.h index 5da74971..f20dcff0 100644 --- a/src/valerie/valerie_status.h +++ b/src/valerie/valerie_status.h @@ -21,6 +21,8 @@ #ifndef _VALERIE_STATUS_H_ #define _VALERIE_STATUS_H_ +#include "stdint.h" + #ifdef __cplusplus extern "C" {