void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, INT64 pts)

{

    ContextInfo *ci = (ContextInfo *) ctx;

    AVPicture picture1;

    Imlib_Image image;

    DATA32 *data;



    image = get_cached_image(ci, width, height);



    if (!image) {

        image = imlib_create_image(width, height);

        put_cached_image(ci, image, width, height);

    }



    imlib_context_set_image(image);

    data = imlib_image_get_data();



    if (pix_fmt != PIX_FMT_RGBA32) {

        avpicture_fill(&picture1, (UINT8 *) data, PIX_FMT_RGBA32, width, height);

        if (img_convert(&picture1, PIX_FMT_RGBA32, 

                        picture, pix_fmt, width, height) < 0) {

            goto done;

        }

    } else {

        av_abort();

    }



    imlib_image_set_has_alpha(0);



    {

        int wid, hig, h_a, v_a;                                                   

        char buff[1000];

        char tbuff[1000];

        char *tbp = ci->text;

        time_t now = time(0);

        char *p, *q;

        int x, y;



        if (ci->file) {

            int fd = open(ci->file, O_RDONLY);



            if (fd < 0) {

                tbp = "[File not found]";

            } else {

                int l = read(fd, tbuff, sizeof(tbuff) - 1);



                if (l >= 0) {

                    tbuff[l] = 0;

                    tbp = tbuff;

                } else {

                    tbp = "[I/O Error]";

                }

                close(fd);

            }

        }



        strftime(buff, sizeof(buff), tbp, localtime(&now));



        x = ci->x;

        y = ci->y;



        for (p = buff; p; p = q) {

            q = strchr(p, '\n');

            if (q)

                *q++ = 0;



            imlib_text_draw_with_return_metrics(x, y, p, &wid, &hig, &h_a, &v_a);

            y += v_a;

        }

    }



    if (pix_fmt != PIX_FMT_RGBA32) {

        if (img_convert(picture, pix_fmt, 

                        &picture1, PIX_FMT_RGBA32, width, height) < 0) {

        }

    }



done:

    ;

}

void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, INT64 pts)

{

    ContextInfo *ci = (ContextInfo *) ctx;

    AVPicture picture1;

    Imlib_Image image;

    DATA32 *data;



    image = get_cached_image(ci, width, height);



    if (!image) {

        image = imlib_create_image(width, height);

        put_cached_image(ci, image, width, height);

    }



    imlib_context_set_image(image);

    data = imlib_image_get_data();



    if (pix_fmt != PIX_FMT_RGBA32) {

        avpicture_fill(&picture1, (UINT8 *) data, PIX_FMT_RGBA32, width, height);

        if (img_convert(&picture1, PIX_FMT_RGBA32, 

                        picture, pix_fmt, width, height) < 0) {

            goto done;

        }

    } else {

        av_abort();

    }



    imlib_image_set_has_alpha(0);



    {

        int wid, hig, h_a, v_a;                                                   

        char buff[1000];

        char tbuff[1000];

        char *tbp = ci->text;

        time_t now = time(0);

        char *p, *q;

        int x, y;



        if (ci->file) {

            int fd = open(ci->file, O_RDONLY);



            if (fd < 0) {

                tbp = "[File not found]";

            } else {

                int l = read(fd, tbuff, sizeof(tbuff) - 1);



                if (l >= 0) {

                    tbuff[l] = 0;

                    tbp = tbuff;

                } else {

                    tbp = "[I/O Error]";

                }

                close(fd);

            }

        }



        strftime(buff, sizeof(buff), tbp, localtime(&now));



        x = ci->x;

        y = ci->y;



        for (p = buff; p; p = q) {

            q = strchr(p, '\n');

            if (q)

                *q++ = 0;



            imlib_text_draw_with_return_metrics(x, y, p, &wid, &hig, &h_a, &v_a);

            y += v_a;

        }

    }



    if (pix_fmt != PIX_FMT_RGBA32) {

        if (img_convert(picture, pix_fmt, 

                        &picture1, PIX_FMT_RGBA32, width, height) < 0) {

        }

    }



done:

    ;

}

void FUNC_0(void *VAR_0, AVPicture *VAR_1, enum PixelFormat VAR_2, int VAR_3, int VAR_4, INT64 VAR_5)

{

    ContextInfo *ci = (ContextInfo *) VAR_0;

    AVPicture picture1;

    Imlib_Image image;

    DATA32 *data;



    image = get_cached_image(ci, VAR_3, VAR_4);



    if (!image) {

        image = imlib_create_image(VAR_3, VAR_4);

        put_cached_image(ci, image, VAR_3, VAR_4);

    }



    imlib_context_set_image(image);

    data = imlib_image_get_data();



    if (VAR_2 != PIX_FMT_RGBA32) {

        avpicture_fill(&picture1, (UINT8 *) data, PIX_FMT_RGBA32, VAR_3, VAR_4);

        if (img_convert(&picture1, PIX_FMT_RGBA32, 

                        VAR_1, VAR_2, VAR_3, VAR_4) < 0) {

            goto done;

        }

    } else {

        av_abort();

    }



    imlib_image_set_has_alpha(0);



    {

        int VAR_6, VAR_7, VAR_8, VAR_9;                                                   

        char VAR_10[1000];

        char VAR_11[1000];

        char *VAR_12 = ci->text;

        time_t now = time(0);

        char *VAR_13, *VAR_14;

        int VAR_15, VAR_16;



        if (ci->file) {

            int VAR_17 = open(ci->file, O_RDONLY);



            if (VAR_17 < 0) {

                VAR_12 = "[File not found]";

            } else {

                int VAR_18 = read(VAR_17, VAR_11, sizeof(VAR_11) - 1);



                if (VAR_18 >= 0) {

                    VAR_11[VAR_18] = 0;

                    VAR_12 = VAR_11;

                } else {

                    VAR_12 = "[I/O Error]";

                }

                close(VAR_17);

            }

        }



        strftime(VAR_10, sizeof(VAR_10), VAR_12, localtime(&now));



        VAR_15 = ci->VAR_15;

        VAR_16 = ci->VAR_16;



        for (VAR_13 = VAR_10; VAR_13; VAR_13 = VAR_14) {

            VAR_14 = strchr(VAR_13, '\n');

            if (VAR_14)

                *VAR_14++ = 0;



            imlib_text_draw_with_return_metrics(VAR_15, VAR_16, VAR_13, &VAR_6, &VAR_7, &VAR_8, &VAR_9);

            VAR_16 += VAR_9;

        }

    }



    if (VAR_2 != PIX_FMT_RGBA32) {

        if (img_convert(VAR_1, VAR_2, 

                        &picture1, PIX_FMT_RGBA32, VAR_3, VAR_4) < 0) {

        }

    }



done:

    ;

}

void FUNC_0(void *VAR_0, AVPicture *VAR_1, enum PixelFormat VAR_2, int VAR_3, int VAR_4, INT64 VAR_5)
{ ContextInfo *ci = (ContextInfo *) VAR_0; AVPicture picture1; Imlib_Image image; DATA32 *data; image = get_cached_image(ci, VAR_3, VAR_4); if (!image) { image = imlib_create_image(VAR_3, VAR_4); put_cached_image(ci, image, VAR_3, VAR_4); } imlib_context_set_image(image); data = imlib_image_get_data(); if (VAR_2 != PIX_FMT_RGBA32) { avpicture_fill(&picture1, (UINT8 *) data, PIX_FMT_RGBA32, VAR_3, VAR_4); if (img_convert(&picture1, PIX_FMT_RGBA32,
VAR_1, VAR_2, VAR_3, VAR_4) < 0) { goto done; } } else { av_abort(); } imlib_image_set_has_alpha(0); { int VAR_6, VAR_7, VAR_8, VAR_9; char VAR_10[1000]; char VAR_11[1000]; char *VAR_12 = ci->text; time_t now = time(0); char *VAR_13, *VAR_14; int VAR_15, VAR_16; if (ci->file) { int VAR_17 = open(ci->file, O_RDONLY); if (VAR_17 < 0) { VAR_12 = "[File not found]"; } else { int VAR_18 = read(VAR_17, VAR_11, sizeof(VAR_11) - 1); if (VAR_18 >= 0) { VAR_11[VAR_18] = 0; VAR_12 = VAR_11; } else { VAR_12 = "[I/O Error]"; } close(VAR_17); } } strftime(VAR_10, sizeof(VAR_10), VAR_12, localtime(&now)); VAR_15 = ci->VAR_15; VAR_16 = ci->VAR_16; for (VAR_13 = VAR_10; VAR_13; VAR_13 = VAR_14) { VAR_14 = strchr(VAR_13, '\n'); if (VAR_14)
*VAR_14++ = 0; imlib_text_draw_with_return_metrics(VAR_15, VAR_16, VAR_13, &VAR_6, &VAR_7, &VAR_8, &VAR_9); VAR_16 += VAR_9; } } if (VAR_2 != PIX_FMT_RGBA32) { if (img_convert(VAR_1, VAR_2,
&picture1, PIX_FMT_RGBA32, VAR_3, VAR_4) < 0) { } } done:
; }