[retro-gtk] retro-gobject: Default aspect ratio to width/height
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] retro-gobject: Default aspect ratio to width/height
- Date: Thu, 26 Jan 2017 10:31:49 +0000 (UTC)
commit 2ecf599e5373b00ba0b5810b38305cd36ad382f1
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Jan 26 10:59:20 2017 +0100
retro-gobject: Default aspect ratio to width/height
Follow the Libretro specification and default the aspect ration to
width/height.
This avoids having an invalid aspect ratio as long as the width and
height are valid.
https://bugzilla.gnome.org/show_bug.cgi?id=777489
retro-gobject/retro-environment.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/retro-gobject/retro-environment.c b/retro-gobject/retro-environment.c
index 3f70e5a..d769943 100644
--- a/retro-gobject/retro-environment.c
+++ b/retro-gobject/retro-environment.c
@@ -429,7 +429,10 @@ void retro_core_set_system_av_info (RetroCore *self, RetroSystemAvInfo *system_a
self->_frames_per_second = system_av_info->timing.fps;
g_object_notify (G_OBJECT (self), "frames-per-second");
}
- self->aspect_ratio = system_av_info->geometry.aspect_ratio;
+ if (system_av_info->geometry.aspect_ratio > 0.f)
+ self->aspect_ratio = system_av_info->geometry.aspect_ratio;
+ else
+ self->aspect_ratio = system_av_info->geometry.base_width /
system_av_info->geometry.base_height;
self->sample_rate = system_av_info->timing.sample_rate;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]