aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-24 02:50:02 +0000
committerGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-24 02:50:02 +0000
commite07d2921f41c14f15b525af0397751d1df05b720 (patch)
tree13ae09891124e6c641f547d1b49d57b8157f6872 /libvo
parent21043e0d28ad0a42bc8b8d4aa6b2e900cccb7ace (diff)
do not fault if no directbuffer available (for example: ggi display-multi)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4832 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_ggi.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/libvo/vo_ggi.c b/libvo/vo_ggi.c
index 867d334fde..1ee1ee9949 100644
--- a/libvo/vo_ggi.c
+++ b/libvo/vo_ggi.c
@@ -27,7 +27,7 @@
#undef GET_DB_INFO
-/* max buffers */
+/* maximum buffers */
#define GGI_FRAMES 4
#include "../postproc/rgb2rgb.h"
@@ -130,14 +130,12 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
if (ggiSetMode(ggi_conf.vis, &mode))
{
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set mode\n");
- uninit();
return(-1);
}
if (ggiGetMode(ggi_conf.vis, &mode) != 0)
{
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get mode\n");
- uninit();
return(-1);
}
@@ -183,20 +181,28 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
default:
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] Unknown image format: %s\n",
vo_format_name(ggi_conf.srcformat));
- uninit();
return(-1);
}
vo_dwidth = ggi_conf.dstwidth = ggi_conf.gmode.virt.x;
vo_dheight = ggi_conf.dstheight = ggi_conf.gmode.virt.y;
- for (i = 0; i < GGI_FRAMES; i++)
- ggi_conf.buffer[i] = NULL;
+ ggi_conf.frames = ggiDBGetNumBuffers(ggi_conf.vis);
+ if (ggi_conf.frames > GGI_FRAMES)
+ ggi_conf.frames = GGI_FRAMES;
+
+ ggi_conf.currframe = 0;
+ if (!ggi_conf.frames)
+ {
+ mp_msg(MSGT_VO, MSGL_ERR, "[ggi] direct buffer unavailable\n");
+ return(-1);
+ }
- ggi_conf.frames = ggi_conf.currframe = 0;
+ for (i = 0; i < ggi_conf.frames; i++)
+ ggi_conf.buffer[i] = NULL;
/* get available number of buffers */
- for (i = 0; DB = ggiDBGetBuffer(ggi_conf.vis, i), i < GGI_FRAMES; i++)
+ for (i = 0; DB = ggiDBGetBuffer(ggi_conf.vis, i), i < ggi_conf.frames; i++)
{
if (!(DB->type & GGI_DB_SIMPLE_PLB) ||
(DB->page_size != 0) ||
@@ -207,13 +213,11 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
continue;
ggi_conf.buffer[DB->frame] = DB;
- ggi_conf.frames++;
}
if (ggi_conf.buffer[0] == NULL)
{
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] direct buffer unavailable\n");
- uninit();
return(-1);
}