X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=b652b9efae2f503d1628359d377e9c6b34e063c8;hb=a8be96087b2f59f05330f2a6320baa62d31d5c03;hp=844a0557cd7a4ae8f7de590f46708249212d004a;hpb=7abf52c63a1ad0acd2c3b2e490c768e112480e63;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 844a055..b652b9e 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -194,14 +194,14 @@ int consumer_start( mlt_consumer parent ) } else { - if ( SDL_GetVideoSurface( ) != NULL ) - this->sdl_screen = SDL_GetVideoSurface( ); + this->sdl_screen = SDL_GetVideoSurface( ); } if ( !mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( parent ), "audio_off" ) ) SDL_InitSubSystem( SDL_INIT_AUDIO ); - this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags ); + if ( this->sdl_screen == NULL ) + this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags ); pthread_create( &this->thread, NULL, consumer_thread, this ); } @@ -289,9 +289,6 @@ static void sdl_fill_audio( void *udata, uint8_t *stream, int len ) // Just to be safe, wipe the stream first memset( stream, 0, len ); - // Copy what we have into the stream - memcpy( stream, this->audio_buffer, this->audio_avail ); - // Mix the audio SDL_MixAudio( stream, this->audio_buffer, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) ); @@ -343,7 +340,7 @@ static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_aud memset( &request, 0, sizeof( SDL_AudioSpec ) ); this->playing = 0; request.freq = frequency; - request.format = AUDIO_S16; + request.format = AUDIO_S16SYS; request.channels = channels; request.samples = audio_buffer; request.callback = sdl_fill_audio;