static int subviewer_decode_frame(AVCodecContext *avctx,

                                  void *data, int *got_sub_ptr, AVPacket *avpkt)

{

    char c;

    AVSubtitle *sub = data;

    const char *ptr = avpkt->data;

    AVBPrint buf;



    /* To be removed later */

    if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) {

        av_log(avctx, AV_LOG_ERROR, "AVPacket is not clean (contains timing "

               "information). You need to upgrade your libavformat or "

               "sanitize your packet.\n");

        return AVERROR_INVALIDDATA;

    }



    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);

    // note: no need to rescale pts & duration since they are in the same

    // timebase as ASS (1/100)

    if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr))

        ff_ass_add_rect(sub, buf.str, avpkt->pts, avpkt->duration, 0);

    *got_sub_ptr = sub->num_rects > 0;

    av_bprint_finalize(&buf, NULL);

    return avpkt->size;

}

static int subviewer_decode_frame(AVCodecContext *avctx,

                                  void *data, int *got_sub_ptr, AVPacket *avpkt)

{

    char c;

    AVSubtitle *sub = data;

    const char *ptr = avpkt->data;

    AVBPrint buf;



    

    if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) {

        av_log(avctx, AV_LOG_ERROR, "AVPacket is not clean (contains timing "

               "information). You need to upgrade your libavformat or "

               "sanitize your packet.\n");

        return AVERROR_INVALIDDATA;

    }



    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);

    

    

    if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr))

        ff_ass_add_rect(sub, buf.str, avpkt->pts, avpkt->duration, 0);

    *got_sub_ptr = sub->num_rects > 0;

    av_bprint_finalize(&buf, NULL);

    return avpkt->size;

}

    if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1) {
static int FUNC_0(AVCodecContext *VAR_0,

                                  void *VAR_1, int *VAR_2, AVPacket *VAR_3)

{

    char VAR_4;

    AVSubtitle *sub = VAR_1;

    const char *VAR_5 = VAR_3->VAR_1;

    AVBPrint buf;



    

    if (sscanf(VAR_5, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%VAR_4", &VAR_4) == 1) {

        av_log(VAR_0, AV_LOG_ERROR, "AVPacket is not clean (contains timing "

               "information). You need to upgrade your libavformat or "

               "sanitize your packet.\n");

        return AVERROR_INVALIDDATA;

    }



    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);

    

    

    if (VAR_5 && VAR_3->size > 0 && !subviewer_event_to_ass(&buf, VAR_5))

        ff_ass_add_rect(sub, buf.str, VAR_3->pts, VAR_3->duration, 0);

    *VAR_2 = sub->num_rects > 0;

    av_bprint_finalize(&buf, NULL);

    return VAR_3->size;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2, AVPacket *VAR_3)
{ char VAR_4; AVSubtitle *sub = VAR_1; const char *VAR_5 = VAR_3->VAR_1; AVBPrint buf; if (sscanf(VAR_5, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%VAR_4", &VAR_4) == 1) { av_log(VAR_0, AV_LOG_ERROR, "AVPacket is not clean (contains timing "
"information). You need to upgrade your libavformat or "
"sanitize your packet.\n"); return AVERROR_INVALIDDATA; } av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); if (VAR_5 && VAR_3->size > 0 && !subviewer_event_to_ass(&buf, VAR_5))
ff_ass_add_rect(sub, buf.str, VAR_3->pts, VAR_3->duration, 0); *VAR_2 = sub->num_rects > 0; av_bprint_finalize(&buf, NULL); return VAR_3->size; }