[FFmpeg-devel] [PATCH] param check in sws_getCachedContext()
Michael Niedermayer
michaelni
Sat Jan 12 00:22:20 CET 2008
On Wed, Jan 09, 2008 at 07:15:19PM +0900, KO Myung-Hun wrote:
> Hi/2.
>
> sws_getCachecContext() always calls sws_getContext() if 'param' is NULL
> or its address is changed.
>
> So, 'param' should be checked as the patch.
>
> --
> KO Myung-Hun
>
> Using Mozilla SeaMonkey 1.1.7
> Under OS/2 Warp 4 for Korean with FixPak #15
> On AMD ThunderBird 750 MHz with 512 MB RAM
>
> Korean OS/2 User Community : http://www.ecomstation.co.kr
>
>
> Index: libswscale/swscale.c
> ===================================================================
> --- libswscale/swscale.c (revision 25625)
> +++ libswscale/swscale.c (working copy)
> @@ -2964,7 +2964,8 @@
> (context->srcFormat != srcFormat) ||
> (context->dstW != dstW) || (context->dstH != dstH) ||
> (context->dstFormat != dstFormat) || (context->flags != flags) ||
> - (context->param != param))
> + (param && (( context->param[ 0 ] != param[ 0 ] ) || ( context->param[ 1 ] != param[ 1 ] ))) ||
> + (!param && (( context->param[ 0 ] != SWS_PARAM_DEFAULT ) || ( context->param[ 1 ] != SWS_PARAM_DEFAULT ))))
> {
i think
double default_param[2]= {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT};
if(!param){
param= default_param;
and
memcmp(context->param, param, sizeof(context->param))
to be clearer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080112/11c43edf/attachment.pgp>
More information about the ffmpeg-devel
mailing list