static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,

                                    AVPacket *pkt, uint64_t display_duration)

{

    char *line, *layer, *ptr = pkt->data, *end = ptr+pkt->size;

    for (; *ptr!=',' && ptr<end-1; ptr++);

    if (*ptr == ',')

        layer = ++ptr;

    for (; *ptr!=',' && ptr<end-1; ptr++);

    if (*ptr == ',') {

        int64_t end_pts = pkt->pts + display_duration;

        int sc = matroska->time_scale * pkt->pts / 10000000;

        int ec = matroska->time_scale * end_pts  / 10000000;

        int sh, sm, ss, eh, em, es, len;

        sh = sc/360000;  sc -= 360000*sh;

        sm = sc/  6000;  sc -=   6000*sm;

        ss = sc/   100;  sc -=    100*ss;

        eh = ec/360000;  ec -= 360000*eh;

        em = ec/  6000;  ec -=   6000*em;

        es = ec/   100;  ec -=    100*es;

        *ptr++ = '\0';

        len = 50 + end-ptr + FF_INPUT_BUFFER_PADDING_SIZE;

        if (!(line = av_malloc(len)))

            return;

        snprintf(line,len,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",

                 layer, sh, sm, ss, sc, eh, em, es, ec, ptr);

        av_free(pkt->data);

        pkt->data = line;

        pkt->size = strlen(line);

    }

}

static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,

                                    AVPacket *pkt, uint64_t display_duration)

{

    char *line, *layer, *ptr = pkt->data, *end = ptr+pkt->size;

    for (; *ptr!=',' && ptr<end-1; ptr++);

    if (*ptr == ',')

        layer = ++ptr;

    for (; *ptr!=',' && ptr<end-1; ptr++);

    if (*ptr == ',') {

        int64_t end_pts = pkt->pts + display_duration;

        int sc = matroska->time_scale * pkt->pts / 10000000;

        int ec = matroska->time_scale * end_pts  / 10000000;

        int sh, sm, ss, eh, em, es, len;

        sh = sc/360000;  sc -= 360000*sh;

        sm = sc/  6000;  sc -=   6000*sm;

        ss = sc/   100;  sc -=    100*ss;

        eh = ec/360000;  ec -= 360000*eh;

        em = ec/  6000;  ec -=   6000*em;

        es = ec/   100;  ec -=    100*es;

        *ptr++ = '\0';

        len = 50 + end-ptr + FF_INPUT_BUFFER_PADDING_SIZE;

        if (!(line = av_malloc(len)))

            return;

        snprintf(line,len,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",

                 layer, sh, sm, ss, sc, eh, em, es, ec, ptr);

        av_free(pkt->data);

        pkt->data = line;

        pkt->size = strlen(line);

    }

}

        snprintf(line,len,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",
static void FUNC_0(MatroskaDemuxContext *VAR_0,

                                    AVPacket *VAR_1, uint64_t VAR_2)

{

    char *VAR_3, *VAR_4, *VAR_5 = VAR_1->data, *VAR_6 = VAR_5+VAR_1->size;

    for (; *VAR_5!=',' && VAR_5<VAR_6-1; VAR_5++);

    if (*VAR_5 == ',')

        VAR_4 = ++VAR_5;

    for (; *VAR_5!=',' && VAR_5<VAR_6-1; VAR_5++);

    if (*VAR_5 == ',') {

        int64_t end_pts = VAR_1->pts + VAR_2;

        int VAR_7 = VAR_0->time_scale * VAR_1->pts / 10000000;

        int VAR_8 = VAR_0->time_scale * end_pts  / 10000000;

        int VAR_9, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14, VAR_15;

        VAR_9 = VAR_7/360000;  VAR_7 -= 360000*VAR_9;

        VAR_10 = VAR_7/  6000;  VAR_7 -=   6000*VAR_10;

        VAR_11 = VAR_7/   100;  VAR_7 -=    100*VAR_11;

        VAR_12 = VAR_8/360000;  VAR_8 -= 360000*VAR_12;

        VAR_13 = VAR_8/  6000;  VAR_8 -=   6000*VAR_13;

        VAR_14 = VAR_8/   100;  VAR_8 -=    100*VAR_14;

        *VAR_5++ = '\0';

        VAR_15 = 50 + VAR_6-VAR_5 + FF_INPUT_BUFFER_PADDING_SIZE;

        if (!(VAR_3 = av_malloc(VAR_15)))

            return;

        snprintf(VAR_3,VAR_15,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",

                 VAR_4, VAR_9, VAR_10, VAR_11, VAR_7, VAR_12, VAR_13, VAR_14, VAR_8, VAR_5);

        av_free(VAR_1->data);

        VAR_1->data = VAR_3;

        VAR_1->size = strlen(VAR_3);

    }

}

static void FUNC_0(MatroskaDemuxContext *VAR_0,
AVPacket *VAR_1, uint64_t VAR_2)
{ char *VAR_3, *VAR_4, *VAR_5 = VAR_1->data, *VAR_6 = VAR_5+VAR_1->size; for (; *VAR_5!=',' && VAR_5<VAR_6-1; VAR_5++); if (*VAR_5 == ',')
VAR_4 = ++VAR_5; for (; *VAR_5!=',' && VAR_5<VAR_6-1; VAR_5++); if (*VAR_5 == ',') { int64_t end_pts = VAR_1->pts + VAR_2; int VAR_7 = VAR_0->time_scale * VAR_1->pts / 10000000; int VAR_8 = VAR_0->time_scale * end_pts  / 10000000; int VAR_9, VAR_10, VAR_11, VAR_12, VAR_13, VAR_14, VAR_15; VAR_9 = VAR_7/360000;  VAR_7 -= 360000*VAR_9; VAR_10 = VAR_7/  6000;  VAR_7 -=   6000*VAR_10; VAR_11 = VAR_7/   100;  VAR_7 -=    100*VAR_11; VAR_12 = VAR_8/360000;  VAR_8 -= 360000*VAR_12; VAR_13 = VAR_8/  6000;  VAR_8 -=   6000*VAR_13; VAR_14 = VAR_8/   100;  VAR_8 -=    100*VAR_14; *VAR_5++ = '\0'; VAR_15 = 50 + VAR_6-VAR_5 + FF_INPUT_BUFFER_PADDING_SIZE; if (!(VAR_3 = av_malloc(VAR_15)))
return; snprintf(VAR_3,VAR_15,"Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s",
VAR_4, VAR_9, VAR_10, VAR_11, VAR_7, VAR_12, VAR_13, VAR_14, VAR_8, VAR_5); av_free(VAR_1->data); VAR_1->data = VAR_3; VAR_1->size = strlen(VAR_3); } }