summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-01 09:30:11 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-01 09:30:11 +0000
commit5caa6d592baf36c4cbbb66cce06195bc4ae60e5c (patch)
tree08bcc6c5148a880c72d45ba4c96557fc8c2d4523 /libmpcodecs
parent2957e84806d0a02875fa65964ac546511161fd26 (diff)
downloadmpv-5caa6d592baf36c4cbbb66cce06195bc4ae60e5c.tar.bz2
mpv-5caa6d592baf36c4cbbb66cce06195bc4ae60e5c.tar.xz
fix image dimensions at filter config time
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14074 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd.c2
-rw-r--r--libmpcodecs/vf.c23
-rw-r--r--libmpcodecs/vf.h1
3 files changed, 24 insertions, 2 deletions
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index edfced6deb..bc56293766 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -306,6 +306,8 @@ csp_again:
fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
"MPlayer",out_fmt);
+ vf->w = sh->disp_w;
+ vf->h = sh->disp_h;
if(vf->config(vf,sh->disp_w,sh->disp_h,
screen_size_x,screen_size_y,
fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 902b64e810..60108ed736 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -7,6 +7,10 @@
#include <malloc.h>
#endif
+#ifdef MP_DEBUG
+#include <assert.h>
+#endif
+
#include "../mp_msg.h"
#include "../help_mp.h"
#include "../m_option.h"
@@ -238,7 +242,21 @@ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){
mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h){
mp_image_t* mpi=NULL;
- int w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w;
+ int w2;
+
+#ifdef MP_DEBUG
+ assert(w == -1 || w >= vf->w);
+ assert(h == -1 || h >= vf->h);
+ assert(vf->w > 0);
+ assert(vf->h > 0);
+#endif
+
+// fprintf(stderr, "get_image: %d:%d, vf: %d:%d\n", w,h,vf->w,vf->h);
+
+ if (w == -1) w = vf->w;
+ if (h == -1) h = vf->h;
+
+ w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w;
if(vf->put_image==vf_next_put_image){
// passthru mode, if the plugin uses the fallback/default put_image() code
@@ -274,7 +292,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
}
if(mpi){
mpi->type=mp_imgtype;
- mpi->w=w; mpi->h=h;
+ mpi->w=vf->w; mpi->h=vf->h;
// 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;
@@ -526,6 +544,7 @@ int vf_next_config(struct vf_instance_s* vf,
if(!vf2) return 0; // shouldn't happen!
vf->next=vf2;
}
+ vf->next->w = width; vf->next->h = height;
return vf->next->config(vf->next,width,height,d_width,d_height,voflags,outfmt);
}
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 5586108c2a..fe2b62a10b 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -42,6 +42,7 @@ typedef struct vf_instance_s {
unsigned int default_caps; // used by default query_format()
unsigned int default_reqs; // used by default config()
// data:
+ int w, h;
vf_image_context_t imgctx;
struct vf_instance_s* next;
mp_image_t *dmpi;