X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=943a0d1be0f9d3118ec0a3b28185463f3d07376f;hb=41cbc901f138ce1ba5ed3cbde5942b91d2b803a0;hp=7ad3414321cd90f3533c9fd5a40fcf24e0315053;hpb=5c7accb28f7fe743270523b85e434fedafd8b053;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 7ad3414..943a0d1 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -148,7 +148,7 @@ static void sdl_unlock_display( ) SDL_UnlockSurface( screen ); } -void sdl_fill_audio( void *udata, uint8_t *stream, int len ) +static void sdl_fill_audio( void *udata, uint8_t *stream, int len ) { consumer_sdl this = udata; @@ -199,9 +199,13 @@ static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_aud // Get the properties of this consumer mlt_properties properties = this->properties; mlt_audio_format afmt = mlt_audio_pcm; - int channels; - int samples; - int frequency; + + // Set the preferred params of the test card signal + int channels = 2; + int frequency = 48000; + static int counter = 0; + int samples = mlt_sample_calculator( ( this->height < 576 ? 29.97 : 25 ), frequency, counter++ ); + int16_t *pcm; int bytes; @@ -232,13 +236,10 @@ static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_aud fprintf( stderr, "SDL failed to open audio: %s\n", SDL_GetError() ); init_audio = 2; } - else + else if ( got.size != 0 ) { - if ( got.size != 0 ) - { - SDL_PauseAudio( 0 ); - init_audio = 0; - } + SDL_PauseAudio( 0 ); + init_audio = 0; } }