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 );
}
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 )( ( double )SDL_MIX_MAXVOLUME * volume ) );
+ SDL_MixAudio( stream, this->audio_buffer, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) );
// No audio left
this->audio_avail = 0;