From 297b3d633ad25797a4f355c57964b7ce3aee6936 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 4 Jan 2011 19:40:25 +0200 Subject: try to ensure fbdev buffer is valid --- frontend/plugin_lib.c | 15 +++++++++------ frontend/plugin_lib.h | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'frontend') diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 4e65e2e..a458f0e 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -62,7 +62,7 @@ static void print_cpu_usage(void) pl_text_out16(pl_fbdev_w - 28, pl_fbdev_h - 10, "%3d", tick_per_sec); } -int pl_fbdev_set_mode(int w, int h, int bpp) +void *pl_fbdev_set_mode(int w, int h, int bpp) { void *ret; @@ -82,16 +82,19 @@ int pl_fbdev_set_mode(int w, int h, int bpp) menu_notify_mode_change(w, h, bpp); - return (ret != NULL) ? 0 : -1; + return pl_fbdev_buf; } void *pl_fbdev_flip(void) { flip_cnt++; - if (g_opts & OPT_SHOWFPS) - print_fps(); - if (g_opts & OPT_SHOWCPU) - print_cpu_usage(); + + if (pl_fbdev_buf != NULL) { + if (g_opts & OPT_SHOWFPS) + print_fps(); + if (g_opts & OPT_SHOWCPU) + print_cpu_usage(); + } // let's flip now pl_fbdev_buf = vout_fbdev_flip(layer_fb); diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h index f5c4985..53389d2 100644 --- a/frontend/plugin_lib.h +++ b/frontend/plugin_lib.h @@ -22,7 +22,7 @@ enum { extern void *pl_fbdev_buf; int pl_fbdev_open(void); -int pl_fbdev_set_mode(int w, int h, int bpp); +void *pl_fbdev_set_mode(int w, int h, int bpp); void *pl_fbdev_flip(void); void pl_fbdev_close(void); @@ -31,7 +31,7 @@ void pl_text_out16(int x, int y, const char *texto, ...); struct rearmed_cbs { void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h); int (*pl_fbdev_open)(void); - int (*pl_fbdev_set_mode)(int w, int h, int bpp); + void *(*pl_fbdev_set_mode)(int w, int h, int bpp); void *(*pl_fbdev_flip)(void); void (*pl_fbdev_close)(void); int *fskip_option; -- cgit v1.2.3