]> git.sesse.net Git - mlt/commitdiff
audio/video processing swap
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 2 May 2004 23:13:12 +0000 (23:13 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 2 May 2004 23:13:12 +0000 (23:13 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@301 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c

index aa95f91acbac343157976175b4176d6140b3ffc3..86bed309025fe804f53021d5bf4e8b92bb93a520 100644 (file)
@@ -309,14 +309,6 @@ static void *consumer_read_ahead_thread( void *arg )
                        count = 1;
                }
 
-               // Always process audio
-               if ( !audio_off )
-               {
-                       samples = mlt_sample_calculator( fps, frequency, counter++ );
-                       mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples );
-                       frame->get_audio = NULL;
-               }
-
                // Get the image
                if ( ( time_frame + time_image ) / count < 40000 )
                {
@@ -324,7 +316,6 @@ static void *consumer_read_ahead_thread( void *arg )
                        if ( !video_off )
                                mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
                        mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 1 );
-                       time_image += time_difference( &ante );
 
                        // Reset the skipped count
                        skipped = 0;
@@ -343,6 +334,17 @@ static void *consumer_read_ahead_thread( void *arg )
                                count = 0;
                        }
                }
+
+               // Always process audio
+               if ( !audio_off )
+               {
+                       samples = mlt_sample_calculator( fps, frequency, counter++ );
+                       mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples );
+                       frame->get_audio = NULL;
+               }
+
+               // Increment the time take for this frame
+               time_image += time_difference( &ante );
        }
 
        // Remove the last frame