]> git.sesse.net Git - mlt/commitdiff
mlt_playlist.c: prevent segfault in mlt_playlist_virtual_refresh on closed producers...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 10 Jun 2008 06:37:31 +0000 (06:37 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 10 Jun 2008 06:37:31 +0000 (06:37 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1140 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_playlist.c

index 084af24f55a3acc0cf576b4645f9c349cfde012d..0e0ba09ebcfa73fb7b0aa3ebd0f0f27c2c390601 100644 (file)
@@ -132,28 +132,31 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this )
        {
                // Get the producer
                mlt_producer producer = this->list[ i ]->producer;
-               int current_length = mlt_producer_get_out( producer ) - mlt_producer_get_in( producer ) + 1;
-
-               // Check if the length of the producer has changed
-               if ( this->list[ i ]->frame_in != mlt_producer_get_in( producer ) ||
-                        this->list[ i ]->frame_out != mlt_producer_get_out( producer ) )
+               if ( producer )
                {
-                       // This clip should be removed...
-                       if ( current_length < 1 )
-                       {
-                               this->list[ i ]->frame_in = 0;
-                               this->list[ i ]->frame_out = -1;
-                               this->list[ i ]->frame_count = 0;
-                       }
-                       else 
+                       int current_length = mlt_producer_get_out( producer ) - mlt_producer_get_in( producer ) + 1;
+       
+                       // Check if the length of the producer has changed
+                       if ( this->list[ i ]->frame_in != mlt_producer_get_in( producer ) ||
+                               this->list[ i ]->frame_out != mlt_producer_get_out( producer ) )
                        {
-                               this->list[ i ]->frame_in = mlt_producer_get_in( producer );
-                               this->list[ i ]->frame_out = mlt_producer_get_out( producer );
-                               this->list[ i ]->frame_count = current_length;
+                               // This clip should be removed...
+                               if ( current_length < 1 )
+                               {
+                                       this->list[ i ]->frame_in = 0;
+                                       this->list[ i ]->frame_out = -1;
+                                       this->list[ i ]->frame_count = 0;
+                               }
+                               else 
+                               {
+                                       this->list[ i ]->frame_in = mlt_producer_get_in( producer );
+                                       this->list[ i ]->frame_out = mlt_producer_get_out( producer );
+                                       this->list[ i ]->frame_count = current_length;
+                               }
+       
+                               // Update the producer_length
+                               this->list[ i ]->producer_length = current_length;
                        }
-
-                       // Update the producer_length
-                       this->list[ i ]->producer_length = current_length;
                }
 
                // Calculate the frame_count