]> git.sesse.net Git - mlt/commitdiff
Allow attached filters when used in playlists
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jul 2004 15:44:27 +0000 (15:44 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jul 2004 15:44:27 +0000 (15:44 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@341 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_playlist.c
src/framework/mlt_playlist.h

index acf0fd26d0961324bd28cebeb521894f690551db..2b1435845964db5fba451e0581b695b3903e292a 100644 (file)
@@ -193,10 +193,11 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer
 /** Seek in the virtual playlist.
 */
 
-static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this )
+static mlt_service mlt_playlist_virtual_seek( mlt_playlist this )
 {
        // Default producer to blank
        mlt_producer producer = NULL;
+       mlt_service service = NULL;
 
        // Map playlist position to real producer in virtual playlist
        mlt_position position = mlt_producer_frame( &this->parent );
@@ -264,7 +265,14 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this )
                producer = &this->blank;
        }
 
-       return producer;
+       if ( producer != NULL )
+       {
+               service = mlt_producer_service( producer );
+               while ( mlt_service_consumer( service ) != NULL )
+                       service = mlt_service_consumer( service );
+       }
+
+       return service;
 }
 
 /** Invoked when a producer indicates that it has prematurely reached its end.
@@ -409,6 +417,15 @@ int mlt_playlist_get_clip_info( mlt_playlist this, mlt_playlist_clip_info *info,
                info->length = mlt_producer_get_length( producer );
                info->fps = mlt_producer_get_fps( producer );
        }
+
+       // Determine the consuming filter service
+       if ( info->producer != NULL )
+       {
+               info->service = mlt_producer_service( info->producer );
+               while ( mlt_service_consumer( info->service ) != NULL )
+                       info->service = mlt_service_consumer( info->service );
+       }
+
        return error;
 }
 
@@ -612,10 +629,10 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        mlt_playlist this = producer->child;
 
        // Get the real producer
-       mlt_producer real = mlt_playlist_virtual_seek( this );
+       mlt_service real = mlt_playlist_virtual_seek( this );
 
        // Get the frame
-       mlt_service_get_frame( mlt_producer_service( real ), frame, index );
+       mlt_service_get_frame( real, frame, index );
 
        // Check if we're at the end of the clip
        mlt_properties properties = mlt_frame_properties( *frame );
index b370dc3bdcee2621a875c2e086686947c72726d3..913b60899df709a3d4bdd0332ad6364bb05dd717 100644 (file)
@@ -30,6 +30,7 @@ typedef struct
 {
        int clip;
        mlt_producer producer;
+       mlt_service service;
        mlt_position start;
        char *resource;
        mlt_position frame_in;