catch failed buffer allocation

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16114 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-07-26 20:36:34 +00:00
parent bc7eccf0f1
commit 775c4db7f4
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}