[MPlayer-dev-eng] [PATCH] ASS subtitle speedup (take 2)
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Dec 2 19:35:20 CET 2006
Hello,
On Sat, Dec 02, 2006 at 09:21:23PM +0300, Evgeniy Stepanov wrote:
> Index: libvo/vo_gl.c
> ===================================================================
> --- libvo/vo_gl.c (revision 21443)
> +++ libvo/vo_gl.c (working copy)
I did not review the other parts..
> -static void genEOSD(ass_image_t *img) {
> +static void genEOSD(mp_eosd_images_t *imgs) {
> int sx, sy;
> int tinytexcur = 0;
> int smalltexcur = 0;
> GLuint *curtex;
> GLint scale_type = (scaled_osd) ? GL_LINEAR : GL_NEAREST;
> + ass_image_t *img;
> ass_image_t *i;
> int cnt;
> +
> + if (!imgs || !imgs->imgs) {
> + // clear the displayed elements, if any
> + if (eosdtexCnt || eosdDispList)
> + clearEOSD();
> + return;
> + }
> +
> + if (imgs->changed == 0)
> + // there are elements, but they are unchanged
> + return;
> +
> + // normal processing
> +
> + img = imgs->imgs;
> +
> + if (imgs->changed == 1)
> + // there are elements, but they just moved
> + goto skip_upload;
> +
Should be simplified:
ass_image_t *img = NULL;
[...]
if (imgs) {
img = imgs->imgs;
if (!imgs->changed) // OSD has not changed
return;
if (img && imgs->changed == 1) // only positions of OSD parts have changed
goto skip_upload;
}
Though I wonder if/how the imgs->imgs == NULL && imgs->changed == 1 case
should be handled (your code probably would crash?).
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list