static int srt_decode_frame(AVCodecContext *avctx,

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

{

    AVSubtitle *sub = data;

    AVBPrint buffer;

    int x1 = -1, y1 = -1, x2 = -1, y2 = -1;

    int size, ret;

    const uint8_t *p = av_packet_get_side_data(avpkt, AV_PKT_DATA_SUBTITLE_POSITION, &size);

    FFASSDecoderContext *s = avctx->priv_data;



    if (p && size == 16) {

        x1 = AV_RL32(p     );

        y1 = AV_RL32(p +  4);

        x2 = AV_RL32(p +  8);

        y2 = AV_RL32(p + 12);

    }



    if (avpkt->size <= 0)

        return avpkt->size;



    av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);



    srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);

    ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);

    av_bprint_finalize(&buffer, NULL);

    if (ret < 0)

        return ret;



    *got_sub_ptr = sub->num_rects > 0;

    return avpkt->size;

}

static int srt_decode_frame(AVCodecContext *avctx,

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

{

    AVSubtitle *sub = data;

    AVBPrint buffer;

    int x1 = -1, y1 = -1, x2 = -1, y2 = -1;

    int size, ret;

    const uint8_t *p = av_packet_get_side_data(avpkt, AV_PKT_DATA_SUBTITLE_POSITION, &size);

    FFASSDecoderContext *s = avctx->priv_data;



    if (p && size == 16) {

        x1 = AV_RL32(p     );

        y1 = AV_RL32(p +  4);

        x2 = AV_RL32(p +  8);

        y2 = AV_RL32(p + 12);

    }



    if (avpkt->size <= 0)

        return avpkt->size;



    av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);



    srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);

    ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);

    av_bprint_finalize(&buffer, NULL);

    if (ret < 0)

        return ret;



    *got_sub_ptr = sub->num_rects > 0;

    return avpkt->size;

}

static int FUNC_0(AVCodecContext *VAR_0,

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

{

    AVSubtitle *sub = VAR_1;

    AVBPrint buffer;

    int VAR_4 = -1, VAR_5 = -1, VAR_6 = -1, VAR_7 = -1;

    int VAR_8, VAR_9;

    const uint8_t *VAR_10 = av_packet_get_side_data(VAR_3, AV_PKT_DATA_SUBTITLE_POSITION, &VAR_8);

    FFASSDecoderContext *s = VAR_0->priv_data;



    if (VAR_10 && VAR_8 == 16) {

        VAR_4 = AV_RL32(VAR_10     );

        VAR_5 = AV_RL32(VAR_10 +  4);

        VAR_6 = AV_RL32(VAR_10 +  8);

        VAR_7 = AV_RL32(VAR_10 + 12);

    }



    if (VAR_3->VAR_8 <= 0)

        return VAR_3->VAR_8;



    av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);



    srt_to_ass(VAR_0, &buffer, VAR_3->VAR_1, VAR_4, VAR_5, VAR_6, VAR_7);

    VAR_9 = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);

    av_bprint_finalize(&buffer, NULL);

    if (VAR_9 < 0)

        return VAR_9;



    *VAR_2 = sub->num_rects > 0;

    return VAR_3->VAR_8;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2, AVPacket *VAR_3)
{ AVSubtitle *sub = VAR_1; AVBPrint buffer; int VAR_4 = -1, VAR_5 = -1, VAR_6 = -1, VAR_7 = -1; int VAR_8, VAR_9; const uint8_t *VAR_10 = av_packet_get_side_data(VAR_3, AV_PKT_DATA_SUBTITLE_POSITION, &VAR_8); FFASSDecoderContext *s = VAR_0->priv_data; if (VAR_10 && VAR_8 == 16) { VAR_4 = AV_RL32(VAR_10     ); VAR_5 = AV_RL32(VAR_10 +  4); VAR_6 = AV_RL32(VAR_10 +  8); VAR_7 = AV_RL32(VAR_10 + 12); } if (VAR_3->VAR_8 <= 0)
return VAR_3->VAR_8; av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED); srt_to_ass(VAR_0, &buffer, VAR_3->VAR_1, VAR_4, VAR_5, VAR_6, VAR_7); VAR_9 = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL); av_bprint_finalize(&buffer, NULL); if (VAR_9 < 0)
return VAR_9; *VAR_2 = sub->num_rects > 0; return VAR_3->VAR_8; }