]> git.sesse.net Git - mlt/blobdiff - src/modules/sdl/consumer_sdl.c
demo framework added
[mlt] / src / modules / sdl / consumer_sdl.c
index 74cfd28cb67ad5ac0b2fc052e5a047cbac239493..962d4ae4ab9fc07b6a0b0ef4f372666220bcd212 100644 (file)
@@ -278,7 +278,7 @@ static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_aud
                request.freq = frequency;
                request.format = AUDIO_S16;
                request.channels = channels;
-               request.samples = 4096;
+               request.samples = 1024;
                request.callback = sdl_fill_audio;
                request.userdata = (void *)this;
                if ( SDL_OpenAudio( &request, &got ) != 0 )
@@ -349,12 +349,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame, int64_t elap
                // Get the image, width and height
                mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
 
-               if ( playtime > elapsed + 25000 )
-               {
-                       struct timespec tm = { ( playtime - elapsed ) / 1000000, ( ( playtime - elapsed ) % 1000000 ) * 1000 };
-                       nanosleep( &tm, NULL );
-               }
-
                // Handle events
                if ( this->sdl_screen != NULL )
                {
@@ -457,6 +451,12 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame, int64_t elap
                                SDL_DisplayYUVOverlay( this->sdl_overlay, &this->sdl_screen->clip_rect );
                        }
                }
+
+               if ( playtime > elapsed + 25000 )
+               {
+                       struct timespec tm = { ( playtime - elapsed ) / 1000000, ( ( playtime - elapsed ) % 1000000 ) * 1000 };
+                       nanosleep( &tm, NULL );
+               }
        }
 
        // Close the frame