}
// Default window size
- this->window_width = ( float )this->height * display_ratio;
+ this->window_width = ( double )this->height * display_ratio;
this->window_height = this->height;
// Set the sdl flags
this->running = 1;
this->joined = 0;
- // Allow the user to force resizing to window size
- if ( mlt_properties_get_int( this->properties, "resize" ) )
- {
- mlt_properties_set_int( this->properties, "width", this->width );
- mlt_properties_set_int( this->properties, "height", this->height );
- }
- else
- {
- this->width = mlt_properties_get_int( this->properties, "width" );
- this->height = mlt_properties_get_int( this->properties, "height" );
- }
+ this->width = mlt_properties_get_int( this->properties, "width" );
+ this->height = mlt_properties_get_int( this->properties, "height" );
pthread_create( &this->thread, NULL, consumer_thread, this );
}
consumer_sdl this = udata;
// Get the volume
- float volume = mlt_properties_get_double( this->properties, "volume" );
+ double volume = mlt_properties_get_double( this->properties, "volume" );
pthread_mutex_lock( &this->audio_mutex );
if ( this->audio_avail >= len )
{
// Place in the audio buffer
- memcpy( stream, this->audio_buffer, len );
+ if ( volume != 1.0 )
+ SDL_MixAudio( stream, this->audio_buffer, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) );
+ else
+ memcpy( stream, this->audio_buffer, len );
// Remove len from the audio available
this->audio_avail -= len;
memcpy( stream, this->audio_buffer, this->audio_avail );
// Mix the audio
- SDL_MixAudio( stream, stream, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) );
+ SDL_MixAudio( stream, this->audio_buffer, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) );
// No audio left
this->audio_avail = 0;
if ( this->running )
{
// Determine window's new display aspect ratio
- float this_aspect = ( float )this->window_width / this->window_height;
+ double this_aspect = ( double )this->window_width / this->window_height;
// Get the display aspect ratio
double display_ratio = mlt_properties_get_double( properties, "display_ratio" );
// Determine frame's display aspect ratio
- float frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
+ double frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
// Store the width and height received
this->width = width;