]> git.sesse.net Git - mlt/commitdiff
More miracle mods
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 8 Jan 2004 14:44:13 +0000 (14:44 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 8 Jan 2004 14:44:13 +0000 (14:44 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@42 d19143bc-622f-0410-bfdd-b5b2a6649095

16 files changed:
docs/services.txt
mlt/docs/services.txt
mlt/src/framework/mlt_playlist.c
mlt/src/framework/mlt_playlist.h
mlt/src/framework/mlt_properties.c
mlt/src/miracle/miracle_unit.c
mlt/src/miracle/miracle_unit.h
mlt/src/miracle/miracle_unit_commands.c
mlt/src/modules/dv/producer_libdv.c
src/framework/mlt_playlist.c
src/framework/mlt_playlist.h
src/framework/mlt_properties.c
src/miracle/miracle_unit.c
src/miracle/miracle_unit.h
src/miracle/miracle_unit_commands.c
src/modules/dv/producer_libdv.c

index cc79a245ff7fb7960df3c449120e59e8e7044c4e..791c5aaba8b6a56392fa366eb62c4e801d19307d 100644 (file)
@@ -102,7 +102,8 @@ Producers
 
                Known Bugs
 
-                       Can be problematic with source NTSC DV files? really?
+                       Can be problematic with source NTSC DV files? really? yes - try
+                       playing pond.dv...
 
        mcmpeg
 
index cc79a245ff7fb7960df3c449120e59e8e7044c4e..791c5aaba8b6a56392fa366eb62c4e801d19307d 100644 (file)
@@ -102,7 +102,8 @@ Producers
 
                Known Bugs
 
-                       Can be problematic with source NTSC DV files? really?
+                       Can be problematic with source NTSC DV files? really? yes - try
+                       playing pond.dv...
 
        mcmpeg
 
index d11f9562ddbab8a55443ece34d4ebddeccb32a9c..168bf62a87281dd053d37ae3ebb19209e572c67b 100644 (file)
@@ -322,6 +322,7 @@ mlt_timecode mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int index
 int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index )
 {
        int error = index < 0 || index >= this->count;
+       memset( info, 0, sizeof( mlt_playlist_clip_info ) );
        if ( !error )
        {
                mlt_producer producer = this->list[ index ]->producer;
@@ -350,6 +351,7 @@ int mlt_playlist_count( mlt_playlist this )
 int mlt_playlist_clear( mlt_playlist this )
 {
        this->count = 0;
+       mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 );
        return mlt_playlist_virtual_refresh( this );
 }
 
@@ -383,6 +385,24 @@ int mlt_playlist_blank( mlt_playlist this, mlt_timecode length )
        return mlt_playlist_virtual_append( this, &this->blank, 0, length );
 }
 
+/** Insert a producer into the playlist.
+*/
+
+int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out )
+{
+       return 0;
+}
+
+int mlt_playlist_remove( mlt_playlist this, int where )
+{
+       return 0;
+}
+
+int mlt_playlist_move( mlt_playlist this, int from, int to )
+{
+       return 0;
+}
+
 /** Get the current frame.
 */
 
index 3e30ba6be8425966bcb7560522d823326c17c4b0..8a5ff317355b4379d5f89e56cfefd2a634fd2a16 100644 (file)
@@ -53,6 +53,9 @@ extern mlt_timecode mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int
 extern int mlt_playlist_current_clip( mlt_playlist this );
 extern mlt_producer mlt_playlist_current( mlt_playlist this );
 extern int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index );
+extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
+extern int mlt_playlist_remove( mlt_playlist this, int where );
+extern int mlt_playlist_move( mlt_playlist this, int from, int to );
 extern void mlt_playlist_close( mlt_playlist this );
 
 #endif
index eb571ad110715a4a8c9ed77da7b296f03c4bf277..679d97ad06f701ad8471478f01891b9ca581bd9f 100644 (file)
@@ -342,9 +342,13 @@ void mlt_properties_close( mlt_properties this )
        property_list *list = this->private;
        int index = 0;
 
+       int debug = mlt_properties_get_int( this, "debug" );
+
        // Clean up names and values
        for ( index = 0; index < list->count; index ++ )
        {
+               if ( debug )
+                       fprintf( stderr, "closing %s\n", list->name[ index ] );
                free( list->name[ index ] );
                mlt_property_close( list->value[ index ] );
        }
index 31c01cf7cdb869a7be8a787a3caf5f2e0978e217..f7d5509e9d9f5d583f0c46c08cadd3e395f71dcc 100644 (file)
@@ -252,37 +252,30 @@ valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in,
        return valerie_invalid_file;
 }
 
-valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
+       mlt_producer instance = create_producer( unit, clip );
+
+       if ( instance != NULL )
        {
-               error = dv_player_insert_file( player, (char*) clip, index, in, out );
-               dv1394d_log( LOG_DEBUG, "inserted clip %s", clip );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
+               mlt_properties properties = unit->properties;
+               mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+               mlt_playlist_insert( playlist, instance, index, in, out );
+               miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+               miracle_unit_status_communicate( unit );
+               return valerie_ok;
        }
-       return error;
-       */
-       return valerie_ok;
+
+       return valerie_invalid_file;
 }
 
 valerie_error_code miracle_unit_remove( miracle_unit unit, int index )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
-       {
-               error = dv_player_remove_clip( player, index );
-               dv1394d_log( LOG_DEBUG, "removed clip %d", index );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
-       }
-       return error;
-       */
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       mlt_playlist_remove( playlist, index );
+       miracle_log( LOG_DEBUG, "removed clip at %d", index );
+       miracle_unit_status_communicate( unit );
        return valerie_ok;
 }
 
@@ -295,18 +288,11 @@ valerie_error_code miracle_unit_clean( miracle_unit unit )
 
 valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
-       {
-               error = dv_player_move_clip( player, src, dest );
-               dv1394d_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
-       }
-       return error;
-       */
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       mlt_playlist_move( playlist, src, dest );
+       miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+       miracle_unit_status_communicate( unit );
        return valerie_ok;
 }
 
@@ -450,16 +436,15 @@ void miracle_unit_change_position( miracle_unit unit, int clip, double position
        miracle_unit_status_communicate( unit );
 }
 
-/** Change speed.
+/** Get the index of the current clip.
 */
 
-void miracle_unit_change_speed( miracle_unit unit, int speed )
-{
-}
-
 int    miracle_unit_get_current_clip( miracle_unit unit )
 {
-       return 0;
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       int clip_index = mlt_playlist_current_clip( playlist );
+       return clip_index;
 }
 
 /** Set a clip's in point
index fabfe5a84915dd9165b298ee484cc5ac3d744755..1acb9496310a4ba79d9efa8e34a33de8718f1aca 100644 (file)
@@ -43,7 +43,7 @@ extern miracle_unit         miracle_unit_init( int index, char *arg );
 extern void                            miracle_unit_report_list( miracle_unit unit, valerie_response response );
 extern void                 miracle_unit_allow_stdin( miracle_unit unit, int flag );
 extern valerie_error_code   miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code      miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out );
+extern valerie_error_code      miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
 extern valerie_error_code   miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
 extern valerie_error_code      miracle_unit_remove( miracle_unit unit, int index );
 extern valerie_error_code      miracle_unit_clean( miracle_unit unit );
index a630422bb95ab0f052d175b0911abd54d3e7b816..c85aff05b75c77f208c4d0e78f3943f323707e7e 100644 (file)
@@ -80,36 +80,29 @@ int miracle_list( command_argument cmd_arg )
 
        return RESPONSE_INVALID_UNIT;
 }
-/*
+
 static int parse_clip( command_argument cmd_arg, int arg )
 {
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
-       int clip = dv_unit_get_current_clip( unit );
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
+       int clip = miracle_unit_get_current_clip( unit );
        
-       if ( dv_tokeniser_count( cmd_arg->tokeniser ) > arg )
+       if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > arg )
        {
-               dv_player player = dv_unit_get_dv_player( unit );
-               char *token = dv_tokeniser_get_string( cmd_arg->tokeniser, arg );
+               char *token = valerie_tokeniser_get_string( cmd_arg->tokeniser, arg );
                if ( token[ 0 ] == '+' )
                        clip += atoi( token + 1 );
                else if ( token[ 0 ] == '-' )
                        clip -= atoi( token + 1 );
                else
                        clip = atoi( token );
-               if ( clip < 0 )
-                       clip = 0;
-               if ( clip >= player->size )
-                       clip = player->size - 1;
        }
        
        return clip;
 }
-*/
 
 int miracle_insert( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        char *filename = (char*) cmd_arg->argument;
        char fullname[1024];
 
@@ -125,30 +118,26 @@ int miracle_insert( command_argument cmd_arg )
                long in = -1, out = -1;
                int index = parse_clip( cmd_arg, 3 );
                
-               if ( dv_tokeniser_count( cmd_arg->tokeniser ) == 6 )
+               if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 6 )
                {
-                       in = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
-                       out = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
+                       in = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+                       out = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
                }
                
-               switch( dv_unit_insert( unit, fullname, index, in, out ) )
+               switch( miracle_unit_insert( unit, fullname, index, in, out ) )
                {
-                       case dv_pump_ok:
+                       case valerie_ok:
                                return RESPONSE_SUCCESS;
-                       case dv_pump_too_many_files_open:
-                               return RESPONSE_TOO_MANY_FILES;
                        default:
                                return RESPONSE_BAD_FILE;
                }
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_remove( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
@@ -156,42 +145,38 @@ int miracle_remove( command_argument cmd_arg )
        {
                int index = parse_clip( cmd_arg, 2 );
                        
-               if ( dv_unit_remove( unit, index ) != dv_pump_ok )
+               if ( miracle_unit_remove( unit, index ) != valerie_ok )
                        return RESPONSE_BAD_FILE;
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_clean( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
        else
        {
-               if ( dv_unit_clean( unit ) != dv_pump_ok )
+               if ( miracle_unit_clean( unit ) != valerie_ok )
                        return RESPONSE_BAD_FILE;
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_move( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if ( unit != NULL )
        {
-               if ( dv_tokeniser_count( cmd_arg->tokeniser ) > 2 )
+               if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > 2 )
                {
                        int src = parse_clip( cmd_arg, 2 );
                        int dest = parse_clip( cmd_arg, 3 );
                        
-                       if ( dv_unit_move( unit, src, dest ) != dv_pump_ok )
+                       if ( miracle_unit_move( unit, src, dest ) != valerie_ok )
                                return RESPONSE_BAD_FILE;
                }
                else
@@ -203,7 +188,6 @@ int miracle_move( command_argument cmd_arg )
        {
                return RESPONSE_INVALID_UNIT;
        }
-       */
 
        return RESPONSE_SUCCESS;
 }
@@ -291,31 +275,27 @@ int miracle_rewind( command_argument cmd_arg )
 
 int miracle_step( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
-       if (unit == NULL || dv_unit_is_offline(unit))
+       if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
        else
        {
-               dv_unit_play( unit, 0 );
-               dv_unit_step( unit, *(int*) cmd_arg->argument );
+               miracle_unit_play( unit, 0 );
+               miracle_unit_step( unit, *(int*) cmd_arg->argument );
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_goto( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        int clip = parse_clip( cmd_arg, 3 );
        
-       if (unit == NULL || dv_unit_is_offline(unit))
+       if (unit == NULL || miracle_unit_is_offline(unit))
                return RESPONSE_INVALID_UNIT;
        else
-               dv_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
-       */
+               miracle_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
        return RESPONSE_SUCCESS;
 }
 
index bc233d123c65156b2d45a86aeabaaa806e979e9d..4e2e9f7055c0fd3bae6991f4a1e4978be0291eb5 100644 (file)
@@ -321,7 +321,7 @@ static void producer_close( mlt_producer parent )
        producer_libdv this = parent->child;
 
        // Free the dv deconder
-       dv_decoder_free( this->dv_decoder );
+       //dv_decoder_free( this->dv_decoder );
 
        // Close the file
        if ( this->fd != 0 )
index d11f9562ddbab8a55443ece34d4ebddeccb32a9c..168bf62a87281dd053d37ae3ebb19209e572c67b 100644 (file)
@@ -322,6 +322,7 @@ mlt_timecode mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int index
 int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index )
 {
        int error = index < 0 || index >= this->count;
+       memset( info, 0, sizeof( mlt_playlist_clip_info ) );
        if ( !error )
        {
                mlt_producer producer = this->list[ index ]->producer;
@@ -350,6 +351,7 @@ int mlt_playlist_count( mlt_playlist this )
 int mlt_playlist_clear( mlt_playlist this )
 {
        this->count = 0;
+       mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 );
        return mlt_playlist_virtual_refresh( this );
 }
 
@@ -383,6 +385,24 @@ int mlt_playlist_blank( mlt_playlist this, mlt_timecode length )
        return mlt_playlist_virtual_append( this, &this->blank, 0, length );
 }
 
+/** Insert a producer into the playlist.
+*/
+
+int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out )
+{
+       return 0;
+}
+
+int mlt_playlist_remove( mlt_playlist this, int where )
+{
+       return 0;
+}
+
+int mlt_playlist_move( mlt_playlist this, int from, int to )
+{
+       return 0;
+}
+
 /** Get the current frame.
 */
 
index 3e30ba6be8425966bcb7560522d823326c17c4b0..8a5ff317355b4379d5f89e56cfefd2a634fd2a16 100644 (file)
@@ -53,6 +53,9 @@ extern mlt_timecode mlt_playlist_clip( mlt_playlist this, mlt_whence whence, int
 extern int mlt_playlist_current_clip( mlt_playlist this );
 extern mlt_producer mlt_playlist_current( mlt_playlist this );
 extern int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info, int index );
+extern int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_timecode in, mlt_timecode out );
+extern int mlt_playlist_remove( mlt_playlist this, int where );
+extern int mlt_playlist_move( mlt_playlist this, int from, int to );
 extern void mlt_playlist_close( mlt_playlist this );
 
 #endif
index eb571ad110715a4a8c9ed77da7b296f03c4bf277..679d97ad06f701ad8471478f01891b9ca581bd9f 100644 (file)
@@ -342,9 +342,13 @@ void mlt_properties_close( mlt_properties this )
        property_list *list = this->private;
        int index = 0;
 
+       int debug = mlt_properties_get_int( this, "debug" );
+
        // Clean up names and values
        for ( index = 0; index < list->count; index ++ )
        {
+               if ( debug )
+                       fprintf( stderr, "closing %s\n", list->name[ index ] );
                free( list->name[ index ] );
                mlt_property_close( list->value[ index ] );
        }
index 31c01cf7cdb869a7be8a787a3caf5f2e0978e217..f7d5509e9d9f5d583f0c46c08cadd3e395f71dcc 100644 (file)
@@ -252,37 +252,30 @@ valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, double in,
        return valerie_invalid_file;
 }
 
-valerie_error_code miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out )
+valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
+       mlt_producer instance = create_producer( unit, clip );
+
+       if ( instance != NULL )
        {
-               error = dv_player_insert_file( player, (char*) clip, index, in, out );
-               dv1394d_log( LOG_DEBUG, "inserted clip %s", clip );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
+               mlt_properties properties = unit->properties;
+               mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+               mlt_playlist_insert( playlist, instance, index, in, out );
+               miracle_log( LOG_DEBUG, "inserted clip %s at %d", clip, index );
+               miracle_unit_status_communicate( unit );
+               return valerie_ok;
        }
-       return error;
-       */
-       return valerie_ok;
+
+       return valerie_invalid_file;
 }
 
 valerie_error_code miracle_unit_remove( miracle_unit unit, int index )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
-       {
-               error = dv_player_remove_clip( player, index );
-               dv1394d_log( LOG_DEBUG, "removed clip %d", index );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
-       }
-       return error;
-       */
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       mlt_playlist_remove( playlist, index );
+       miracle_log( LOG_DEBUG, "removed clip at %d", index );
+       miracle_unit_status_communicate( unit );
        return valerie_ok;
 }
 
@@ -295,18 +288,11 @@ valerie_error_code miracle_unit_clean( miracle_unit unit )
 
 valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest )
 {
-       /*
-       dv_player player = miracle_unit_get_dv_player( unit );
-       valerie_error_code error = dv_player_get_error( player );
-       if ( error == dv_pump_ok )
-       {
-               error = dv_player_move_clip( player, src, dest );
-               dv1394d_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
-               if ( unit->is_terminated )
-                       miracle_unit_status_communicate( unit );
-       }
-       return error;
-       */
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       mlt_playlist_move( playlist, src, dest );
+       miracle_log( LOG_DEBUG, "moved clip %d to %d", src, dest );
+       miracle_unit_status_communicate( unit );
        return valerie_ok;
 }
 
@@ -450,16 +436,15 @@ void miracle_unit_change_position( miracle_unit unit, int clip, double position
        miracle_unit_status_communicate( unit );
 }
 
-/** Change speed.
+/** Get the index of the current clip.
 */
 
-void miracle_unit_change_speed( miracle_unit unit, int speed )
-{
-}
-
 int    miracle_unit_get_current_clip( miracle_unit unit )
 {
-       return 0;
+       mlt_properties properties = unit->properties;
+       mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
+       int clip_index = mlt_playlist_current_clip( playlist );
+       return clip_index;
 }
 
 /** Set a clip's in point
index fabfe5a84915dd9165b298ee484cc5ac3d744755..1acb9496310a4ba79d9efa8e34a33de8718f1aca 100644 (file)
@@ -43,7 +43,7 @@ extern miracle_unit         miracle_unit_init( int index, char *arg );
 extern void                            miracle_unit_report_list( miracle_unit unit, valerie_response response );
 extern void                 miracle_unit_allow_stdin( miracle_unit unit, int flag );
 extern valerie_error_code   miracle_unit_load( miracle_unit unit, char *clip, double in, double out, int flush );
-extern valerie_error_code      miracle_unit_insert( miracle_unit unit, const char *clip, int index, double in, double out );
+extern valerie_error_code      miracle_unit_insert( miracle_unit unit, char *clip, int index, double in, double out );
 extern valerie_error_code   miracle_unit_append( miracle_unit unit, char *clip, double in, double out );
 extern valerie_error_code      miracle_unit_remove( miracle_unit unit, int index );
 extern valerie_error_code      miracle_unit_clean( miracle_unit unit );
index a630422bb95ab0f052d175b0911abd54d3e7b816..c85aff05b75c77f208c4d0e78f3943f323707e7e 100644 (file)
@@ -80,36 +80,29 @@ int miracle_list( command_argument cmd_arg )
 
        return RESPONSE_INVALID_UNIT;
 }
-/*
+
 static int parse_clip( command_argument cmd_arg, int arg )
 {
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
-       int clip = dv_unit_get_current_clip( unit );
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
+       int clip = miracle_unit_get_current_clip( unit );
        
-       if ( dv_tokeniser_count( cmd_arg->tokeniser ) > arg )
+       if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > arg )
        {
-               dv_player player = dv_unit_get_dv_player( unit );
-               char *token = dv_tokeniser_get_string( cmd_arg->tokeniser, arg );
+               char *token = valerie_tokeniser_get_string( cmd_arg->tokeniser, arg );
                if ( token[ 0 ] == '+' )
                        clip += atoi( token + 1 );
                else if ( token[ 0 ] == '-' )
                        clip -= atoi( token + 1 );
                else
                        clip = atoi( token );
-               if ( clip < 0 )
-                       clip = 0;
-               if ( clip >= player->size )
-                       clip = player->size - 1;
        }
        
        return clip;
 }
-*/
 
 int miracle_insert( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        char *filename = (char*) cmd_arg->argument;
        char fullname[1024];
 
@@ -125,30 +118,26 @@ int miracle_insert( command_argument cmd_arg )
                long in = -1, out = -1;
                int index = parse_clip( cmd_arg, 3 );
                
-               if ( dv_tokeniser_count( cmd_arg->tokeniser ) == 6 )
+               if ( valerie_tokeniser_count( cmd_arg->tokeniser ) == 6 )
                {
-                       in = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
-                       out = atoi( dv_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
+                       in = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 4 ) );
+                       out = atoi( valerie_tokeniser_get_string( cmd_arg->tokeniser, 5 ) );
                }
                
-               switch( dv_unit_insert( unit, fullname, index, in, out ) )
+               switch( miracle_unit_insert( unit, fullname, index, in, out ) )
                {
-                       case dv_pump_ok:
+                       case valerie_ok:
                                return RESPONSE_SUCCESS;
-                       case dv_pump_too_many_files_open:
-                               return RESPONSE_TOO_MANY_FILES;
                        default:
                                return RESPONSE_BAD_FILE;
                }
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_remove( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
@@ -156,42 +145,38 @@ int miracle_remove( command_argument cmd_arg )
        {
                int index = parse_clip( cmd_arg, 2 );
                        
-               if ( dv_unit_remove( unit, index ) != dv_pump_ok )
+               if ( miracle_unit_remove( unit, index ) != valerie_ok )
                        return RESPONSE_BAD_FILE;
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_clean( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
        else
        {
-               if ( dv_unit_clean( unit ) != dv_pump_ok )
+               if ( miracle_unit_clean( unit ) != valerie_ok )
                        return RESPONSE_BAD_FILE;
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_move( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
        if ( unit != NULL )
        {
-               if ( dv_tokeniser_count( cmd_arg->tokeniser ) > 2 )
+               if ( valerie_tokeniser_count( cmd_arg->tokeniser ) > 2 )
                {
                        int src = parse_clip( cmd_arg, 2 );
                        int dest = parse_clip( cmd_arg, 3 );
                        
-                       if ( dv_unit_move( unit, src, dest ) != dv_pump_ok )
+                       if ( miracle_unit_move( unit, src, dest ) != valerie_ok )
                                return RESPONSE_BAD_FILE;
                }
                else
@@ -203,7 +188,6 @@ int miracle_move( command_argument cmd_arg )
        {
                return RESPONSE_INVALID_UNIT;
        }
-       */
 
        return RESPONSE_SUCCESS;
 }
@@ -291,31 +275,27 @@ int miracle_rewind( command_argument cmd_arg )
 
 int miracle_step( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        
-       if (unit == NULL || dv_unit_is_offline(unit))
+       if (unit == NULL)
                return RESPONSE_INVALID_UNIT;
        else
        {
-               dv_unit_play( unit, 0 );
-               dv_unit_step( unit, *(int*) cmd_arg->argument );
+               miracle_unit_play( unit, 0 );
+               miracle_unit_step( unit, *(int*) cmd_arg->argument );
        }
-       */
        return RESPONSE_SUCCESS;
 }
 
 int miracle_goto( command_argument cmd_arg )
 {
-       /*
-       dv_unit unit = miracle_get_unit(cmd_arg->unit);
+       miracle_unit unit = miracle_get_unit(cmd_arg->unit);
        int clip = parse_clip( cmd_arg, 3 );
        
-       if (unit == NULL || dv_unit_is_offline(unit))
+       if (unit == NULL || miracle_unit_is_offline(unit))
                return RESPONSE_INVALID_UNIT;
        else
-               dv_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
-       */
+               miracle_unit_change_position( unit, clip, *(int*) cmd_arg->argument );
        return RESPONSE_SUCCESS;
 }
 
index bc233d123c65156b2d45a86aeabaaa806e979e9d..4e2e9f7055c0fd3bae6991f4a1e4978be0291eb5 100644 (file)
@@ -321,7 +321,7 @@ static void producer_close( mlt_producer parent )
        producer_libdv this = parent->child;
 
        // Free the dv deconder
-       dv_decoder_free( this->dv_decoder );
+       //dv_decoder_free( this->dv_decoder );
 
        // Close the file
        if ( this->fd != 0 )