fix aspect handling when rescale != none
[melted] / src / modules / sdl / consumer_sdl.c
index b066393..0d483cf 100644 (file)
@@ -454,14 +454,14 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                                this->rect.h = this->window_height;
                        }
                        // Use hardware scaler to normalise sample aspect ratio
-                       else if ( this->window_height * frame_aspect > this->window_width )
+                       else if ( this->window_height * this->display_aspect > this->window_width )
                        {
                                this->rect.w = this->window_width;
-                               this->rect.h = this->window_width / frame_aspect + 0.5;
+                               this->rect.h = this->window_width / this->display_aspect + 0.5;
                        }
                        else
                        {
-                               this->rect.w = this->window_height * frame_aspect + 0.5;
+                               this->rect.w = this->window_height * this->display_aspect + 0.5;
                                this->rect.h = this->window_height;
                        }
                        
@@ -562,7 +562,7 @@ static void *video_thread( void *arg )
                        mlt_position difference = scheduled - elapsed;
 
                        // Smooth playback a bit
-                       if ( difference > 10000 && speed == 1.0 )
+                       if ( difference > 20000 && speed == 1.0 )
                        {
                                tm.tv_sec = difference / 1000000;
                                tm.tv_nsec = ( difference % 1000000 ) * 500;