void av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int flags)
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int distance, int flags)
void av_add_index_entry(AVStream *st,                            int64_t pos, int64_t timestamp, int flags){    AVIndexEntry *entries, *ie;    int index;        entries = av_fast_realloc(st->index_entries,                              &st->index_entries_allocated_size,                              (st->nb_index_entries + 1) *                               sizeof(AVIndexEntry));    st->index_entries= entries;    if(st->nb_index_entries){        index= av_index_search_timestamp(st, timestamp);        ie= &entries[index];        if(ie->timestamp != timestamp){            if(ie->timestamp < timestamp){                index++; //index points to next instead of previous entry, maybe nonexistant                ie= &st->index_entries[index];            }else                assert(index==0);                            if(index != st->nb_index_entries){                assert(index < st->nb_index_entries);                memmove(entries + index + 1, entries + index, sizeof(AVIndexEntry)*(st->nb_index_entries - index));            }            st->nb_index_entries++;        }    }else        ie= &entries[st->nb_index_entries++];        ie->pos = pos;    ie->timestamp = timestamp;    ie->flags = flags;}