summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-18 01:07:37 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-18 01:45:36 +0200
commit186e5a998c8424b3c850b62d6f5755a0928cd64c (patch)
treecabc9881fb5ed2c6dbe5f771323a55c50136a091 /libmpcodecs/vf.c
parent41ac08d2b45f0f6eb369ea57604796be69200185 (diff)
parente5ee1232c5e00e730d69cf57767b1ee3ab5b4e16 (diff)
downloadmpv-186e5a998c8424b3c850b62d6f5755a0928cd64c.tar.bz2
mpv-186e5a998c8424b3c850b62d6f5755a0928cd64c.tar.xz
Merge svn changes up to r28641
Convert vo_x11_border (used in vo_gl/gl2 though the vo_gl_border macro) to use a wrapper macro in old-style VOs which do not provide a VO object argument. Before this function had an explicit global_vo argument in vo_gl/gl2. New vo_vdpau uses it too so use the same mechanism as most other functions.
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r--libmpcodecs/vf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index c2b88b5584..445e631c21 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -3,7 +3,7 @@
#include <string.h>
#include "config.h"
-#ifdef HAVE_MALLOC_H
+#if HAVE_MALLOC_H
#include <malloc.h>
#endif
@@ -319,7 +319,6 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
// keep buffer allocation status & color flags only:
// mpi->flags&=~(MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE|MP_IMGFLAG_DIRECT);
mpi->flags&=MP_IMGFLAG_ALLOCATED|MP_IMGFLAG_TYPE_DISPLAYED|MP_IMGFLAGMASK_COLORS;
- mpi->flags |= MP_IMGFLAG_IN_USE;
// accept restrictions & draw_slice flags only:
mpi->flags|=mp_imgflag&(MP_IMGFLAGMASK_RESTRICTIONS|MP_IMGFLAG_DRAW_CALLBACK);
if(!vf->draw_slice) mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK;
@@ -346,6 +345,11 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
if(!(mpi->flags&MP_IMGFLAG_DIRECT)){
// non-direct and not yet allocated image. allocate it!
+ if (!mpi->bpp) { // no way we can allocate this
+ mp_msg(MSGT_DECVIDEO, MSGL_FATAL,
+ "vf_get_image: Tried to allocate a format that can not be allocated!\n");
+ return NULL;
+ }
// check if codec prefer aligned stride:
if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){
@@ -426,6 +430,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
mpi->qscale = NULL;
}
+ mpi->flags |= MP_IMGFLAG_IN_USE;
// printf("\rVF_MPI: %p %p %p %d %d %d \n",
// mpi->planes[0],mpi->planes[1],mpi->planes[2],
// mpi->stride[0],mpi->stride[1],mpi->stride[2]);