[MPlayer-cvslog] r32009 - in trunk: eosd.c eosd.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Aug 25 07:14:04 CEST 2010


On Tue, Aug 24, 2010 at 12:26:39PM +0200, Nicolas George wrote:
> Concerning the build failure without libass, I propose the following:
> 
> - Immediately, define "struct mp_eosd_image" identical to ASS_Image and
>   cast, just like Grigori did in his patch last month.

Why don't you just use "struct ass_image" in the header?
Then you can just also add a
struct ass_image;
before and it will compile fine without having to know the
internals of ASS_Image.
This is something that should stay like this also for the EOSD,
the struct internals should stay opaque as much as possible,
that's always good design.
On the other hand, casts are always bad design, and in this case
you can't in any way guarantee it will work with external libass,
so I don't think that should be done.

> - In the next patch (eosd-dynamic), change the cast into a copy of the
>   relevant fields while building the concatenated linked list.
> 
> The copy has a little cost, but it is probably nothing in front of an alpha
> blending or an OpenGL texture upload.

As long as you copy only the struct not the whole bitmaps the cost
is completely irrelevant. At most the cost in code maintenance should
be a consideration.


More information about the MPlayer-cvslog mailing list