]> git.sesse.net Git - mlt/commitdiff
Miracle mods
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 10 Feb 2004 13:58:21 +0000 (13:58 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 10 Feb 2004 13:58:21 +0000 (13:58 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@132 d19143bc-622f-0410-bfdd-b5b2a6649095

docs/testing-20040110.txt
src/framework/mlt_playlist.c
src/framework/mlt_producer.c
src/framework/mlt_properties.c
src/miracle/miracle_unit.c
src/valerie/valerie_notifier.c
src/valerie/valerie_status.h

index a8ec9331e8b9e4bb12dc1467438af761f962fafd..731f9e8f5c6973ef889a9ae7de6691e02dbf5773 100644 (file)
@@ -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
 ------------------------------------------------------------------------------
index 7399d51cfc22eed23c72a7234577973787a725e0..4b022101d4312820fc48f6100c388a49cda82035 100644 (file)
@@ -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 )
        {
index 9ae6d798b568951dc9e4ae5c07ce76d4a3528878..3c953d624446774382efa97b77a1dc33549bf3c4 100644 (file)
@@ -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 );
index 27f4a27b6e41c3b43b0b25c3f43dd7db88a4eb32..970fbd4a02bab11f28ee6e42441779641f7f7b9a 100644 (file)
@@ -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 );
+               }
        }
 }
 
index cacdc506cc87c250ca11ff64cef92b7cbc8ef622..700371714b5aa87e29ee999ba2c6b0718ae39184 100644 (file)
@@ -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 );
index 5e374a85f174282959c200747db7e81ee4afad00..9c446504a671ff3c7f72756a1e916d9f10bd9fde 100644 (file)
@@ -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 );
 
index 5da74971c0f01be4cabcf611b3c128d60ea97c12..f20dcff00dafddb4c8f74b041862f97037ce8888 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _VALERIE_STATUS_H_
 #define _VALERIE_STATUS_H_
 
+#include "stdint.h"
+
 #ifdef __cplusplus
 extern "C"
 {