Prevent early returns for video_frame_pixel_scale

This commit is contained in:
twinaphex 2016-11-06 13:57:27 +01:00
parent 483cd0077c
commit 49893c10f5
2 changed files with 4 additions and 9 deletions

View File

@ -569,7 +569,7 @@ static bool init_video_pixel_converter(unsigned size)
/* If pixel format is not 0RGB1555, we don't need to do
* any internal pixel conversion. */
if (video_driver_get_pixel_format() != RETRO_PIXEL_FORMAT_0RGB1555)
if (video_driver_pix_fmt != RETRO_PIXEL_FORMAT_0RGB1555)
return true;
/* No need to perform pixel conversion for HW rendering contexts. */
@ -2083,7 +2083,9 @@ void video_driver_frame(const void *data, unsigned width,
if (!video_driver_is_active())
return;
if (video_driver_scaler_ptr &&
if (video_driver_scaler_ptr && data &&
(video_driver_pix_fmt == RETRO_PIXEL_FORMAT_0RGB1555) &&
(data != RETRO_HW_FRAME_BUFFER_VALID) &&
video_pixel_frame_scale(
video_driver_scaler_ptr->scaler,
video_driver_scaler_ptr->scaler_out,

View File

@ -200,13 +200,6 @@ bool video_pixel_frame_scale(
static struct retro_perf_counter video_frame_conv = {0};
performance_counter_init(&video_frame_conv, "video_frame_conv");
if ( !data
|| video_driver_get_pixel_format() != RETRO_PIXEL_FORMAT_0RGB1555)
return false;
if (data == RETRO_HW_FRAME_BUFFER_VALID)
return false;
performance_counter_start(&video_frame_conv);
scaler->in_width = width;