static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)

{

    mkv_cuepoint *entries = cues->entries;



    entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));

    if (entries == NULL)

        return AVERROR(ENOMEM);



    if (ts < 0)

        return 0;



    entries[cues->num_entries  ].pts = ts;

    entries[cues->num_entries  ].tracknum = stream + 1;

    entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset;



    cues->entries = entries;

    return 0;

}

static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)

{

    mkv_cuepoint *entries = cues->entries;



    entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));

    if (entries == NULL)

        return AVERROR(ENOMEM);



    if (ts < 0)

        return 0;



    entries[cues->num_entries  ].pts = ts;

    entries[cues->num_entries  ].tracknum = stream + 1;

    entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset;



    cues->entries = entries;

    return 0;

}

    if (ts < 0)         return 0;
static int FUNC_0(mkv_cues *VAR_0, int VAR_1, int64_t VAR_2, int64_t VAR_3)

{

    mkv_cuepoint *entries = VAR_0->entries;



    entries = av_realloc(entries, (VAR_0->num_entries + 1) * sizeof(mkv_cuepoint));

    if (entries == NULL)

        return AVERROR(ENOMEM);



    if (VAR_2 < 0)

        return 0;



    entries[VAR_0->num_entries  ].pts = VAR_2;

    entries[VAR_0->num_entries  ].tracknum = VAR_1 + 1;

    entries[VAR_0->num_entries++].VAR_3 = VAR_3 - VAR_0->segment_offset;



    VAR_0->entries = entries;

    return 0;

}

static int FUNC_0(mkv_cues *VAR_0, int VAR_1, int64_t VAR_2, int64_t VAR_3)
{ mkv_cuepoint *entries = VAR_0->entries; entries = av_realloc(entries, (VAR_0->num_entries + 1) * sizeof(mkv_cuepoint)); if (entries == NULL)
return AVERROR(ENOMEM); if (VAR_2 < 0)
return 0; entries[VAR_0->num_entries  ].pts = VAR_2; entries[VAR_0->num_entries  ].tracknum = VAR_1 + 1; entries[VAR_0->num_entries++].VAR_3 = VAR_3 - VAR_0->segment_offset; VAR_0->entries = entries; return 0; }