Commit 6683a37f authored by Diego Pettenò's avatar Diego Pettenò

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).

Originally committed as revision 27734 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent f5a2c981
...@@ -2964,12 +2964,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s ...@@ -2964,12 +2964,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0) if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0)
{ {
static int firstTime=1; //FIXME move this into the context perhaps static int warnedAlready=0; //FIXME move this into the context perhaps
if (flags & SWS_PRINT_INFO && firstTime) if (flags & SWS_PRINT_INFO && !warnedAlready)
{ {
av_log(c, AV_LOG_WARNING, "Warning: dstStride is not aligned!\n" av_log(c, AV_LOG_WARNING, "Warning: dstStride is not aligned!\n"
" ->cannot do aligned memory accesses anymore\n"); " ->cannot do aligned memory accesses anymore\n");
firstTime=0; warnedAlready=1;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment