GNOME Bugzilla – Bug 728353
goom2k1: code does nothing, slowly
Last modified: 2014-10-08 13:08:47 UTC
In gst/goom2k1/filters.c, zoomFilterSetResolution: for (loopv = zf->res_y; loopv != 0;) { int decc = 0; int spdc = 0; int accel = 0; loopv--; zf->firedec[loopv] = decc; decc += spdc / 10; <---- adds 0 spdc += RAND (gd) % 3; <--\ spdc -= RAND (gd) % 3; <--/ those two make spdc range -2..2 if (decc > 4) <----- this thus can't happen spdc -= 1; And there's more below that. I suspect spdc might have been intended to be outside the loop (ie, not be reset to 0 every loop), but that's just a guess. The code was added all in one go, so no history to shed some light upon this.
http://goom.bzr.sourceforge.net/bzr/goom/files/head%3A/src/ Looks like there have been changes in goom. Going to spend tomorrow morning looking into it and possibly updating the GStreamer plugin.
goom is the newer version of that code, goom2k1 is just an older copy because it's visually different
I see. So no need to update the code. Just check if the code in goom2k1 that seems to do nothing can be cleaned nicely.
Created attachment 287852 [details] [review] Remove the block of code that does nothing I have followed the flow of code and executed it extensively. This block of code does nothing. decc and spdc are initialized to zero. decc is added the value of spdc / 10, which is zero. so decc is zero. value of decc is stored in zf->firedec[]. decc is not bigger than 4 or smaller than -4, if blocks don't run. same thing with spdc and bigger than 30 or smaller than -30. again, decc checked for > 8 or < -8, nothing happens. accel gets a random value and never used. loop runs again. I propose we remove this block of unneeded code.
Fixed