[MPlayer-cvslog] CVS: main/libmpcodecs vf.h, 1.24, 1.25 vf.c, 1.108, 1.109 vd.c, 1.79, 1.80
Jindrich Makovicka CVS
syncmail at mplayerhq.hu
Wed Dec 1 10:30:14 CET 2004
CVS change done by Jindrich Makovicka CVS
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv22883
Modified Files:
vf.h vf.c vd.c
Log Message:
fix image dimensions at filter config time
Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- vf.h 9 Oct 2004 13:07:18 -0000 1.24
+++ vf.h 1 Dec 2004 09:30:11 -0000 1.25
@@ -42,6 +42,7 @@
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;
Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- vf.c 31 May 2004 15:07:58 -0000 1.108
+++ vf.c 1 Dec 2004 09:30:11 -0000 1.109
@@ -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 @@
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 @@
}
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 @@
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);
}
Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- vd.c 1 Oct 2004 20:08:21 -0000 1.79
+++ vd.c 1 Dec 2004 09:30:11 -0000 1.80
@@ -306,6 +306,8 @@
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),
More information about the MPlayer-cvslog
mailing list