static void sub2video_update(InputStream *ist, AVSubtitle *sub)

{

    int w = ist->sub2video.w, h = ist->sub2video.h;

    AVFrame *frame = ist->sub2video.frame;

    int8_t *dst;

    int     dst_linesize;

    int num_rects, i;

    int64_t pts, end_pts;



    if (!frame)

        return;

    if (sub) {

        pts       = av_rescale_q(sub->pts + sub->start_display_time * 1000,

                                 AV_TIME_BASE_Q, ist->st->time_base);

        end_pts   = av_rescale_q(sub->pts + sub->end_display_time   * 1000,

                                 AV_TIME_BASE_Q, ist->st->time_base);

        num_rects = sub->num_rects;

    } else {

        pts       = ist->sub2video.end_pts;

        end_pts   = INT64_MAX;

        num_rects = 0;

    }

    if (sub2video_get_blank_frame(ist) < 0) {

        av_log(ist->dec_ctx, AV_LOG_ERROR,

               "Impossible to get a blank canvas.\n");

        return;

    }

    dst          = frame->data    [0];

    dst_linesize = frame->linesize[0];

    for (i = 0; i < num_rects; i++)

        sub2video_copy_rect(dst, dst_linesize, w, h, sub->rects[i]);

    sub2video_push_ref(ist, pts);

    ist->sub2video.end_pts = end_pts;

}

static void sub2video_update(InputStream *ist, AVSubtitle *sub)

{

    int w = ist->sub2video.w, h = ist->sub2video.h;

    AVFrame *frame = ist->sub2video.frame;

    int8_t *dst;

    int     dst_linesize;

    int num_rects, i;

    int64_t pts, end_pts;



    if (!frame)

        return;

    if (sub) {

        pts       = av_rescale_q(sub->pts + sub->start_display_time * 1000,

                                 AV_TIME_BASE_Q, ist->st->time_base);

        end_pts   = av_rescale_q(sub->pts + sub->end_display_time   * 1000,

                                 AV_TIME_BASE_Q, ist->st->time_base);

        num_rects = sub->num_rects;

    } else {

        pts       = ist->sub2video.end_pts;

        end_pts   = INT64_MAX;

        num_rects = 0;

    }

    if (sub2video_get_blank_frame(ist) < 0) {

        av_log(ist->dec_ctx, AV_LOG_ERROR,

               "Impossible to get a blank canvas.\n");

        return;

    }

    dst          = frame->data    [0];

    dst_linesize = frame->linesize[0];

    for (i = 0; i < num_rects; i++)

        sub2video_copy_rect(dst, dst_linesize, w, h, sub->rects[i]);

    sub2video_push_ref(ist, pts);

    ist->sub2video.end_pts = end_pts;

}

        pts       = av_rescale_q(sub->pts + sub->start_display_time * 1000,         end_pts   = av_rescale_q(sub->pts + sub->end_display_time   * 1000,
static void FUNC_0(InputStream *VAR_0, AVSubtitle *VAR_1)

{

    int VAR_2 = VAR_0->sub2video.VAR_2, VAR_3 = VAR_0->sub2video.VAR_3;

    AVFrame *frame = VAR_0->sub2video.frame;

    int8_t *dst;

    int     VAR_4;

    int VAR_5, VAR_6;

    int64_t pts, end_pts;



    if (!frame)

        return;

    if (VAR_1) {

        pts       = av_rescale_q(VAR_1->pts + VAR_1->start_display_time * 1000,

                                 AV_TIME_BASE_Q, VAR_0->st->time_base);

        end_pts   = av_rescale_q(VAR_1->pts + VAR_1->end_display_time   * 1000,

                                 AV_TIME_BASE_Q, VAR_0->st->time_base);

        VAR_5 = VAR_1->VAR_5;

    } else {

        pts       = VAR_0->sub2video.end_pts;

        end_pts   = INT64_MAX;

        VAR_5 = 0;

    }

    if (sub2video_get_blank_frame(VAR_0) < 0) {

        av_log(VAR_0->dec_ctx, AV_LOG_ERROR,

               "Impossible to get a blank canvas.\n");

        return;

    }

    dst          = frame->data    [0];

    VAR_4 = frame->linesize[0];

    for (VAR_6 = 0; VAR_6 < VAR_5; VAR_6++)

        sub2video_copy_rect(dst, VAR_4, VAR_2, VAR_3, VAR_1->rects[VAR_6]);

    sub2video_push_ref(VAR_0, pts);

    VAR_0->sub2video.end_pts = end_pts;

}

static void FUNC_0(InputStream *VAR_0, AVSubtitle *VAR_1)
{ int VAR_2 = VAR_0->sub2video.VAR_2, VAR_3 = VAR_0->sub2video.VAR_3; AVFrame *frame = VAR_0->sub2video.frame; int8_t *dst; int     VAR_4; int VAR_5, VAR_6; int64_t pts, end_pts; if (!frame)
return; if (VAR_1) { pts       = av_rescale_q(VAR_1->pts + VAR_1->start_display_time * 1000,
AV_TIME_BASE_Q, VAR_0->st->time_base); end_pts   = av_rescale_q(VAR_1->pts + VAR_1->end_display_time   * 1000,
AV_TIME_BASE_Q, VAR_0->st->time_base); VAR_5 = VAR_1->VAR_5; } else { pts       = VAR_0->sub2video.end_pts; end_pts   = INT64_MAX; VAR_5 = 0; } if (sub2video_get_blank_frame(VAR_0) < 0) { av_log(VAR_0->dec_ctx, AV_LOG_ERROR,
"Impossible to get a blank canvas.\n"); return; } dst          = frame->data    [0]; VAR_4 = frame->linesize[0]; for (VAR_6 = 0; VAR_6 < VAR_5; VAR_6++) sub2video_copy_rect(dst, VAR_4, VAR_2, VAR_3, VAR_1->rects[VAR_6]); sub2video_push_ref(VAR_0, pts); VAR_0->sub2video.end_pts = end_pts; }