# HG changeset patch # User flameeyes # Date 1223550630 0 # Node ID b6a499f7272552be521fca912f4d8ec897471911 # Parent 5916162c1bd327444911385e41e523a57e7b5000 Invert logic for the single-pass in swScale() functions. Instead of having a firstTime variable defaulting to 1, have a warnedAlready defaulting to 0. While this should make no difference in code speed at runtime, it allows to aggregate the four bytes of that variable with clip_table in .bss section, rather than issuing a .data section just for that. As it is, libswscale require no .data section but .data.rel.ro (that can be mitigated by prelinking), so the change might actually save one page of memory at runtime (per process). diff -r 5916162c1bd3 -r b6a499f72725 libswscale/swscale_template.c --- a/libswscale/swscale_template.c Thu Oct 09 08:36:04 2008 +0000 +++ b/libswscale/swscale_template.c Thu Oct 09 11:10:30 2008 +0000 @@ -2964,12 +2964,12 @@ if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0) { - static int firstTime=1; //FIXME move this into the context perhaps - if (flags & SWS_PRINT_INFO && firstTime) + static int warnedAlready=0; //FIXME move this into the context perhaps + if (flags & SWS_PRINT_INFO && !warnedAlready) { av_log(c, AV_LOG_WARNING, "Warning: dstStride is not aligned!\n" " ->cannot do aligned memory accesses anymore\n"); - firstTime=0; + warnedAlready=1; } }