[MPlayer-dev-eng] [PATCH] EOSD support for VDPAU (2nd)

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Feb 22 20:40:56 CET 2009


On Sun, Feb 22, 2009 at 08:06:45PM +0100, Grigori G wrote:
> +        for (j=0; j<eosd_surface_count; j++) {
> +            if (eosd_surfaces[j].surface != VDP_INVALID_HANDLE
> +                && eosd_surfaces[j].in_use == 0 && eosd_surfaces[j].w >= i->w
> +                && eosd_surfaces[j].h >= i->h) {
> +                found = j;
> +                break;
> +            }
> +        }
[...]
> +        eosd_surfaces[found].w = i->w;
> +        eosd_surfaces[found].h = i->h;

This will make reusing far harder, since above you are comparing against
the dimensions of the last image that was stored in the surface, instead
of the real dimensions of the surface as they were allocated.
E.g. if in consecutive frames you had each time one ASS image with the
dimensions
first frame: 32x32
second frame: 16x16
third frame: 32x32
your code would unnecessarily create a new surface for the third frame.



More information about the MPlayer-dev-eng mailing list