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;
if ( mlt_properties_get_int( properties, "rendered" ) == 1 && this->running )
{
// Obtain the scheduled playout time
- mlt_position scheduled = mlt_properties_get_position( properties, "playtime" );
+ int64_t scheduled = mlt_properties_get_int( properties, "playtime" );
// Determine the difference between the elapsed time and the scheduled playout time
- mlt_position difference = scheduled - elapsed;
+ int64_t difference = scheduled - elapsed;
// Smooth playback a bit
if ( real_time && ( difference > 20000 && speed == 1.0 ) )
}
// Set playtime for this frame
- mlt_properties_set_position( properties, "playtime", playtime );
+ mlt_properties_set_int( properties, "playtime", playtime );
while ( this->running && mlt_deque_count( this->queue ) > 15 )
nanosleep( &tm, NULL );