summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-05-10 16:03:56 +0200
committerJohns <johns98@gmx.net>2012-05-10 16:03:56 +0200
commit541754a6190fe022f8e67b9ca08423c2e07db91d (patch)
tree8dda62330d3edf64d1683609d62a26ff7a4f4e6a /video.c
parent3772b2160ce79e56c33ff336d4a41823f5cdc45a (diff)
downloadvdr-plugin-softhddevice-541754a6190fe022f8e67b9ca08423c2e07db91d.tar.gz
vdr-plugin-softhddevice-541754a6190fe022f8e67b9ca08423c2e07db91d.tar.bz2
Support display with non-square pixels.
Diffstat (limited to 'video.c')
-rw-r--r--video.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video.c b/video.c
index 75aca6c..f7666c7 100644
--- a/video.c
+++ b/video.c
@@ -284,6 +284,7 @@ static Display *XlibDisplay; ///< Xlib X11 display
static xcb_connection_t *Connection; ///< xcb connection
static xcb_colormap_t VideoColormap; ///< video colormap
static xcb_window_t VideoWindow; ///< video window
+static xcb_screen_t const *VideoScreen; ///< video screen
static uint32_t VideoBlankTick; ///< blank cursor timer
static xcb_cursor_t VideoBlankCursor; ///< empty invisible cursor
@@ -461,8 +462,11 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
}
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
- input_width * input_aspect_ratio.num,
- input_height * input_aspect_ratio.den, 1024 * 1024);
+ (int64_t) input_width * input_aspect_ratio.num *
+ VideoScreen->width_in_pixels * VideoScreen->height_in_millimeters,
+ (int64_t) input_height * input_aspect_ratio.den *
+ VideoScreen->height_in_pixels * VideoScreen->width_in_millimeters,
+ 1024 * 1024);
// InputWidth/Height can be zero = uninitialized
if (!display_aspect_ratio.num || !display_aspect_ratio.den) {
@@ -10077,7 +10081,7 @@ void VideoInit(const char *display_name)
int screen_nr;
int i;
xcb_screen_iterator_t screen_iter;
- xcb_screen_t *screen;
+ xcb_screen_t const *screen;
if (XlibDisplay) { // allow multiple calls
Debug(3, "video: x11 already setup\n");
@@ -10122,6 +10126,7 @@ void VideoInit(const char *display_name)
xcb_screen_next(&screen_iter);
}
screen = screen_iter.data;
+ VideoScreen = screen;
//
// Default window size