From 775c4db7f4cdaf39a010d817316c456dcb2a87f3 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 26 Jul 2005 20:36:34 +0000 Subject: [PATCH] catch failed buffer allocation git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16114 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 37c8e162b1..b7933a6dde 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -485,6 +485,7 @@ static uint32_t get_image(mp_image_t *mpi) { if (!err_shown) mp_msg(MSGT_VO, MSGL_ERR, "[gl] extensions missing for dr\n" "Expect a _major_ speed penalty\n"); + err_shown = 1; return VO_FALSE; } if (mpi->flags & MP_IMGFLAG_READABLE) return VO_FALSE; @@ -498,6 +499,13 @@ static uint32_t get_image(mp_image_t *mpi) { } mpi->planes[0] = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + if (mpi->planes[0] == NULL) { + if (!err_shown) + mp_msg(MSGT_VO, MSGL_ERR, "[gl] could not aquire buffer for dr\n" + "Expect a _major_ speed penalty\n"); + err_shown = 1; + return VO_FALSE; + } mpi->flags |= MP_IMGFLAG_DIRECT; return VO_TRUE; }