# HG changeset patch # User arpi # Date 1018222259 0 # Node ID 30679378f8149066205a59d0a64045a18a62923a # Parent 80679a6ccb4e286658e333bb7a7f385abd6b0278 free old context, really use query_format diff -r 80679a6ccb4e -r 30679378f814 libmpcodecs/vf_scale.c --- a/libmpcodecs/vf_scale.c Sun Apr 07 22:45:07 2002 +0000 +++ b/libmpcodecs/vf_scale.c Sun Apr 07 23:30:59 2002 +0000 @@ -37,6 +37,7 @@ unsigned int flags, unsigned int outfmt){ unsigned int* p=outfmt_list; unsigned int best=0; + // find the best outfmt: while(*p){ int ret=vf_next_query_format(vf,*p); @@ -57,6 +58,9 @@ printf("SwScale scaling %dx%d %s to %dx%d %s \n", width,height,vo_format_name(outfmt), vf->priv->w,vf->priv->h,vo_format_name(best)); + + // free old ctx: + if(vf->priv->ctx) freeSwsContext(vf->priv->ctx); // new swscaler: vf->priv->ctx=getSwsContextFromCmdLine(width,height,outfmt, @@ -108,6 +112,7 @@ static int open(vf_instance_t *vf, char* args){ vf->config=config; vf->put_image=put_image; + vf->query_format=query_format; vf->priv=malloc(sizeof(struct vf_priv_s)); // TODO: parse args -> vf->priv->ctx=NULL;