// Default scaler (for now we'll use nearest)
mlt_properties_set( this->properties, "rescale", "nearest" );
+ // Default buffer for low latency
+ mlt_properties_set_int( this->properties, "buffer", 8 );
+
// Default progressive true
mlt_properties_set_int( this->properties, "progressive", 1 );
this->width = mlt_properties_get_int( this->properties, "width" );
this->height = mlt_properties_get_int( this->properties, "height" );
}
-
+
// Default window size
- this->window_width = (int)( (float)this->height * this->aspect_ratio ) + 1;
+ this->window_width = (int)( (float)this->height * 4.0/3.0 + 0.5);
this->window_height = this->height;
// Set the sdl flags
// Set skip
mlt_properties_set_position( mlt_frame_properties( frame ), "playtime", playtime );
- mlt_properties_set_double( mlt_frame_properties( frame ), "consumer_scale", ( double )height / mlt_properties_get_double( properties, "height" ) );
// Push this frame to the back of the queue
mlt_deque_push_back( this->queue, frame );
// Get the image, width and height
mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
- if ( playtime > elapsed + 20000 )
+ if ( playtime > elapsed + 25000 )
{
struct timespec tm = { ( playtime - elapsed ) / 1000000, ( ( playtime - elapsed ) % 1000000 ) * 1000 };
nanosleep( &tm, NULL );
if ( this->sdl_screen == NULL || changed )
{
- double aspect_ratio = mlt_frame_get_aspect_ratio( frame );
- float display_aspect_ratio = (float)width / (float)height;
+ double aspect_ratio = ( float )this->aspect_ratio * this->width / this->height;
+ float display_aspect_ratio = ( float )width / height;
SDL_Rect rect;
-
- if ( mlt_properties_get_double( properties, "aspect_ratio" ) )
- aspect_ratio = mlt_properties_get_double( properties, "aspect_ratio" );
+ if ( mlt_properties_get( properties, "rescale" ) != NULL &&
+ !strcmp( mlt_properties_get( properties, "rescale" ), "none" ) )
+ aspect_ratio = mlt_frame_get_aspect_ratio( frame ) * mlt_properties_get_int(mlt_frame_properties(frame),"width") / mlt_properties_get_int(mlt_frame_properties(frame),"height");
if ( aspect_ratio == 1 )
{
else if ( this->window_width < this->window_height * aspect_ratio )
{
rect.w = this->window_width;
- rect.h = this->window_width / aspect_ratio;
+ rect.h = this->window_width / aspect_ratio + 1;
}
else
{
- rect.w = this->window_height * aspect_ratio;
+ rect.w = this->window_height * aspect_ratio + 1;
rect.h = this->window_height;
}
while( this->running )
{
// Get a frame from the attached producer
- mlt_frame frame = mlt_consumer_rt_frame( consumer, mlt_image_yuv422 );
+ mlt_frame frame = mlt_consumer_rt_frame( consumer );
// Ensure that we have a frame
if ( frame != NULL )
// Finally clean up this
free( this );
}
-