From 1d46befd8150131541aa98e93573d5d6e54e9c3a Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Wed, 14 Jan 2004 13:41:06 +0000 Subject: [PATCH 1/1] Minor mods git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@76 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt/src/framework/mlt_multitrack.c | 4 +- mlt/src/framework/mlt_playlist.c | 2 +- mlt/src/framework/mlt_producer.c | 32 ++--------------------------- mlt/src/modules/ffmpeg/producer_ffmpeg.c | 2 + src/framework/mlt_multitrack.c | 4 +- src/framework/mlt_playlist.c | 2 +- src/framework/mlt_producer.c | 32 ++--------------------------- src/modules/ffmpeg/producer_ffmpeg.c | 2 + 8 files changed, 16 insertions(+), 64 deletions(-) diff --git a/mlt/src/framework/mlt_multitrack.c b/mlt/src/framework/mlt_multitrack.c index 47bc271..59b2383 100644 --- a/mlt/src/framework/mlt_multitrack.c +++ b/mlt/src/framework/mlt_multitrack.c @@ -147,7 +147,7 @@ void mlt_multitrack_refresh( mlt_multitrack this ) // Update multitrack properties now - we'll not destroy the in point here mlt_properties_set_position( properties, "length", length ); - mlt_properties_set_position( properties, "out", length ); + mlt_properties_set_position( properties, "out", length - 1 ); mlt_properties_set_double( properties, "fps", fps ); } @@ -298,7 +298,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind mlt_producer producer = this->list[ index ]; // Obtain the current position - uint64_t position = mlt_producer_frame( parent ); + mlt_position position = mlt_producer_frame( parent ); // Make sure we're at the same point mlt_producer_seek( producer, position ); diff --git a/mlt/src/framework/mlt_playlist.c b/mlt/src/framework/mlt_playlist.c index 921bbd5..ff9e273 100644 --- a/mlt/src/framework/mlt_playlist.c +++ b/mlt/src/framework/mlt_playlist.c @@ -149,7 +149,7 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this ) mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps ); mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps == 0 ? 25 : fps ); mlt_properties_set_position( mlt_playlist_properties( this ), "length", frame_count ); - mlt_properties_set_position( mlt_playlist_properties( this ), "out", frame_count ); + mlt_properties_set_position( mlt_playlist_properties( this ), "out", frame_count - 1 ); return 0; } diff --git a/mlt/src/framework/mlt_producer.c b/mlt/src/framework/mlt_producer.c index c874243..f4e5bd5 100644 --- a/mlt/src/framework/mlt_producer.c +++ b/mlt/src/framework/mlt_producer.c @@ -57,9 +57,9 @@ int mlt_producer_init( mlt_producer this, void *child ) mlt_properties_set_double( properties, "frame", 0 ); mlt_properties_set_double( properties, "fps", 25.0 ); mlt_properties_set_double( properties, "speed", 1.0 ); - mlt_properties_set_position( properties, "in", 0.0 ); - mlt_properties_set_position( properties, "out", 179999 ); - mlt_properties_set_position( properties, "length", 180000 ); + mlt_properties_set_position( properties, "in", 0 ); + mlt_properties_set_position( properties, "out", 1799999 ); + mlt_properties_set_position( properties, "length", 1800000 ); mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); mlt_properties_set( properties, "log_id", "multitrack" ); @@ -86,32 +86,6 @@ mlt_properties mlt_producer_properties( mlt_producer this ) return mlt_service_properties( &this->parent ); } -/** Convert frame position to position. -*/ - -/* -mlt_position mlt_producer_time( mlt_producer this, int64_t frame ) -{ - if ( frame < 0 ) - return -1; - else - return ( mlt_position )frame / mlt_producer_get_fps( this ); -} -*/ - -/** Convert position to frame position. -*/ - -/* -int64_t mlt_producer_frame_position( mlt_producer this, mlt_position position ) -{ - if ( position < 0 ) - return -1; - else - return ( int64_t )( floor( position * mlt_producer_get_fps( this ) + 0.5 ) ); -} -*/ - /** Seek to a specified position. */ diff --git a/mlt/src/modules/ffmpeg/producer_ffmpeg.c b/mlt/src/modules/ffmpeg/producer_ffmpeg.c index f383aff..43b8a2e 100644 --- a/mlt/src/modules/ffmpeg/producer_ffmpeg.c +++ b/mlt/src/modules/ffmpeg/producer_ffmpeg.c @@ -202,6 +202,8 @@ mlt_producer producer_ffmpeg_init( char *file ) mlt_properties_set( properties, "log_id", file ); mlt_properties_set( properties, "resource", file ); + mlt_properties_set_position( properties, "length", 36000 ); + mlt_properties_set_position( properties, "out", 36000 ); this->buffer = malloc( 1024 * 1024 * 2 ); diff --git a/src/framework/mlt_multitrack.c b/src/framework/mlt_multitrack.c index 47bc271..59b2383 100644 --- a/src/framework/mlt_multitrack.c +++ b/src/framework/mlt_multitrack.c @@ -147,7 +147,7 @@ void mlt_multitrack_refresh( mlt_multitrack this ) // Update multitrack properties now - we'll not destroy the in point here mlt_properties_set_position( properties, "length", length ); - mlt_properties_set_position( properties, "out", length ); + mlt_properties_set_position( properties, "out", length - 1 ); mlt_properties_set_double( properties, "fps", fps ); } @@ -298,7 +298,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind mlt_producer producer = this->list[ index ]; // Obtain the current position - uint64_t position = mlt_producer_frame( parent ); + mlt_position position = mlt_producer_frame( parent ); // Make sure we're at the same point mlt_producer_seek( producer, position ); diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 921bbd5..ff9e273 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -149,7 +149,7 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this ) mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps ); mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps == 0 ? 25 : fps ); mlt_properties_set_position( mlt_playlist_properties( this ), "length", frame_count ); - mlt_properties_set_position( mlt_playlist_properties( this ), "out", frame_count ); + mlt_properties_set_position( mlt_playlist_properties( this ), "out", frame_count - 1 ); return 0; } diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index c874243..f4e5bd5 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -57,9 +57,9 @@ int mlt_producer_init( mlt_producer this, void *child ) mlt_properties_set_double( properties, "frame", 0 ); mlt_properties_set_double( properties, "fps", 25.0 ); mlt_properties_set_double( properties, "speed", 1.0 ); - mlt_properties_set_position( properties, "in", 0.0 ); - mlt_properties_set_position( properties, "out", 179999 ); - mlt_properties_set_position( properties, "length", 180000 ); + mlt_properties_set_position( properties, "in", 0 ); + mlt_properties_set_position( properties, "out", 1799999 ); + mlt_properties_set_position( properties, "length", 1800000 ); mlt_properties_set_double( properties, "aspect_ratio", 4.0 / 3.0 ); mlt_properties_set( properties, "log_id", "multitrack" ); @@ -86,32 +86,6 @@ mlt_properties mlt_producer_properties( mlt_producer this ) return mlt_service_properties( &this->parent ); } -/** Convert frame position to position. -*/ - -/* -mlt_position mlt_producer_time( mlt_producer this, int64_t frame ) -{ - if ( frame < 0 ) - return -1; - else - return ( mlt_position )frame / mlt_producer_get_fps( this ); -} -*/ - -/** Convert position to frame position. -*/ - -/* -int64_t mlt_producer_frame_position( mlt_producer this, mlt_position position ) -{ - if ( position < 0 ) - return -1; - else - return ( int64_t )( floor( position * mlt_producer_get_fps( this ) + 0.5 ) ); -} -*/ - /** Seek to a specified position. */ diff --git a/src/modules/ffmpeg/producer_ffmpeg.c b/src/modules/ffmpeg/producer_ffmpeg.c index f383aff..43b8a2e 100644 --- a/src/modules/ffmpeg/producer_ffmpeg.c +++ b/src/modules/ffmpeg/producer_ffmpeg.c @@ -202,6 +202,8 @@ mlt_producer producer_ffmpeg_init( char *file ) mlt_properties_set( properties, "log_id", file ); mlt_properties_set( properties, "resource", file ); + mlt_properties_set_position( properties, "length", 36000 ); + mlt_properties_set_position( properties, "out", 36000 ); this->buffer = malloc( 1024 * 1024 * 2 ); -- 1.7.4.4