X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=bdae25c13ab8d7fcad6459c3a7f4091bb928ad39;hb=bc14039bada8702953117bc424d00c2bf56d42f5;hp=ee62a2d7ac7e2ef26c0db1b36908f43381ae1f23;hpb=2af8bb9f6a61f6510aab8f45abf5f26e9e619c78;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index ee62a2d..bdae25c 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -274,7 +274,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 = 2048; + request.samples = 4096; request.callback = sdl_fill_audio; request.userdata = (void *)this; if ( SDL_OpenAudio( &request, &got ) != 0 ) @@ -514,7 +514,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame, int64_t elap if ( frame != NULL ) mlt_frame_close( frame ); - return error; + return error || frame == NULL; } /** Threaded wrapper for pipe. @@ -561,7 +561,7 @@ static void *consumer_thread( void *arg ) while ( !done ) { // Play audio - if ( sizeof( this->audio_buffer ) - this->audio_avail > 8192 || mlt_deque_count( this->queue ) == 1 ) + if ( sizeof( this->audio_buffer ) - this->audio_avail > 8192 || mlt_deque_count( this->queue ) < 2 ) { init_audio = consumer_play_audio( this, frame, init_audio, &duration ); done = 1;