static int subtitle_thread(void *arg)

{

    VideoState *is = arg;

    Frame *sp;

    int got_subtitle;

    double pts;

    int i, j;

    int r, g, b, y, u, v, a;



    for (;;) {

        while (is->paused && !is->subtitleq.abort_request) {

            SDL_Delay(10);

        }



        if (!(sp = frame_queue_peek_writable(&is->subpq)))

            return 0;



        if ((got_subtitle = decoder_decode_frame(&is->subdec, &sp->sub)) < 0)

            break;



        pts = 0;



        if (got_subtitle && sp->sub.format == 0) {

            if (sp->sub.pts != AV_NOPTS_VALUE)

                pts = sp->sub.pts / (double)AV_TIME_BASE;

            sp->pts = pts;

            sp->serial = is->subdec.pkt_serial;



            for (i = 0; i < sp->sub.num_rects; i++)

            {

                for (j = 0; j < sp->sub.rects[i]->nb_colors; j++)

                {

                    RGBA_IN(r, g, b, a, (uint32_t*)sp->sub.rects[i]->pict.data[1] + j);

                    y = RGB_TO_Y_CCIR(r, g, b);

                    u = RGB_TO_U_CCIR(r, g, b, 0);

                    v = RGB_TO_V_CCIR(r, g, b, 0);

                    YUVA_OUT((uint32_t*)sp->sub.rects[i]->pict.data[1] + j, y, u, v, a);

                }

            }



            /* now we can update the picture count */

            frame_queue_push(&is->subpq);

        } else if (got_subtitle) {

            avsubtitle_free(&sp->sub);

        }

    }

    return 0;

}

static int subtitle_thread(void *arg)

{

    VideoState *is = arg;

    Frame *sp;

    int got_subtitle;

    double pts;

    int i, j;

    int r, g, b, y, u, v, a;



    for (;;) {

        while (is->paused && !is->subtitleq.abort_request) {

            SDL_Delay(10);

        }



        if (!(sp = frame_queue_peek_writable(&is->subpq)))

            return 0;



        if ((got_subtitle = decoder_decode_frame(&is->subdec, &sp->sub)) < 0)

            break;



        pts = 0;



        if (got_subtitle && sp->sub.format == 0) {

            if (sp->sub.pts != AV_NOPTS_VALUE)

                pts = sp->sub.pts / (double)AV_TIME_BASE;

            sp->pts = pts;

            sp->serial = is->subdec.pkt_serial;



            for (i = 0; i < sp->sub.num_rects; i++)

            {

                for (j = 0; j < sp->sub.rects[i]->nb_colors; j++)

                {

                    RGBA_IN(r, g, b, a, (uint32_t*)sp->sub.rects[i]->pict.data[1] + j);

                    y = RGB_TO_Y_CCIR(r, g, b);

                    u = RGB_TO_U_CCIR(r, g, b, 0);

                    v = RGB_TO_V_CCIR(r, g, b, 0);

                    YUVA_OUT((uint32_t*)sp->sub.rects[i]->pict.data[1] + j, y, u, v, a);

                }

            }



            

            frame_queue_push(&is->subpq);

        } else if (got_subtitle) {

            avsubtitle_free(&sp->sub);

        }

    }

    return 0;

}

        if ((got_subtitle = decoder_decode_frame(&is->subdec, &sp->sub)) < 0)
static int FUNC_0(void *VAR_0)

{

    VideoState *is = VAR_0;

    Frame *sp;

    int VAR_1;

    double VAR_2;

    int VAR_3, VAR_4;

    int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11;



    for (;;) {

        while (is->paused && !is->subtitleq.abort_request) {

            SDL_Delay(10);

        }



        if (!(sp = frame_queue_peek_writable(&is->subpq)))

            return 0;



        if ((VAR_1 = decoder_decode_frame(&is->subdec, &sp->sub)) < 0)

            break;



        VAR_2 = 0;



        if (VAR_1 && sp->sub.format == 0) {

            if (sp->sub.VAR_2 != AV_NOPTS_VALUE)

                VAR_2 = sp->sub.VAR_2 / (double)AV_TIME_BASE;

            sp->VAR_2 = VAR_2;

            sp->serial = is->subdec.pkt_serial;



            for (VAR_3 = 0; VAR_3 < sp->sub.num_rects; VAR_3++)

            {

                for (VAR_4 = 0; VAR_4 < sp->sub.rects[VAR_3]->nb_colors; VAR_4++)

                {

                    RGBA_IN(VAR_5, VAR_6, VAR_7, VAR_11, (uint32_t*)sp->sub.rects[VAR_3]->pict.data[1] + VAR_4);

                    VAR_8 = RGB_TO_Y_CCIR(VAR_5, VAR_6, VAR_7);

                    VAR_9 = RGB_TO_U_CCIR(VAR_5, VAR_6, VAR_7, 0);

                    VAR_10 = RGB_TO_V_CCIR(VAR_5, VAR_6, VAR_7, 0);

                    YUVA_OUT((uint32_t*)sp->sub.rects[VAR_3]->pict.data[1] + VAR_4, VAR_8, VAR_9, VAR_10, VAR_11);

                }

            }



            

            frame_queue_push(&is->subpq);

        } else if (VAR_1) {

            avsubtitle_free(&sp->sub);

        }

    }

    return 0;

}

static int FUNC_0(void *VAR_0)
{ VideoState *is = VAR_0; Frame *sp; int VAR_1; double VAR_2; int VAR_3, VAR_4; int VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11; for (;;) { while (is->paused && !is->subtitleq.abort_request) { SDL_Delay(10); } if (!(sp = frame_queue_peek_writable(&is->subpq)))
return 0; if ((VAR_1 = decoder_decode_frame(&is->subdec, &sp->sub)) < 0)
break; VAR_2 = 0; if (VAR_1 && sp->sub.format == 0) { if (sp->sub.VAR_2 != AV_NOPTS_VALUE)
VAR_2 = sp->sub.VAR_2 / (double)AV_TIME_BASE; sp->VAR_2 = VAR_2; sp->serial = is->subdec.pkt_serial; for (VAR_3 = 0; VAR_3 < sp->sub.num_rects; VAR_3++) { for (VAR_4 = 0; VAR_4 < sp->sub.rects[VAR_3]->nb_colors; VAR_4++) { RGBA_IN(VAR_5, VAR_6, VAR_7, VAR_11, (uint32_t*)sp->sub.rects[VAR_3]->pict.data[1] + VAR_4); VAR_8 = RGB_TO_Y_CCIR(VAR_5, VAR_6, VAR_7); VAR_9 = RGB_TO_U_CCIR(VAR_5, VAR_6, VAR_7, 0); VAR_10 = RGB_TO_V_CCIR(VAR_5, VAR_6, VAR_7, 0); YUVA_OUT((uint32_t*)sp->sub.rects[VAR_3]->pict.data[1] + VAR_4, VAR_8, VAR_9, VAR_10, VAR_11); } } frame_queue_push(&is->subpq); } else if (VAR_1) { avsubtitle_free(&sp->sub); } } return 0; }