diff options
author | James Almer <jamrial@gmail.com> | 2021-03-22 10:17:16 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-03-23 14:09:27 -0300 |
commit | 0be265e9a100adc778c1c3cf52155a6326043b85 (patch) | |
tree | a0fafe3e3f650ed22ac09717e4dee75e6d8f3966 /libavformat/utils.c | |
parent | 5996184bea3e7e7b00ddc6256788cd3e59d75913 (diff) | |
download | ffmpeg-0be265e9a100adc778c1c3cf52155a6326043b85.tar.gz |
Revert "lavf: move AVStream.*index_entries* to AVStreamInternal"
This reverts commit cea7c19cda0ea1630ae1de8c102ab14231b9db10.
Until an API is added to make index_entries public in a proper way, keeping
this here is harmless.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 295e676c9c..6ae87f7b9f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1941,11 +1941,11 @@ void ff_reduce_index(AVFormatContext *s, int stream_index) AVStream *st = s->streams[stream_index]; unsigned int max_entries = s->max_index_size / sizeof(AVIndexEntry); - if ((unsigned) st->internal->nb_index_entries >= max_entries) { + if ((unsigned) st->nb_index_entries >= max_entries) { int i; - for (i = 0; 2 * i < st->internal->nb_index_entries; i++) - st->internal->index_entries[i] = st->internal->index_entries[2 * i]; - st->internal->nb_index_entries = i; + for (i = 0; 2 * i < st->nb_index_entries; i++) + st->index_entries[i] = st->index_entries[2 * i]; + st->nb_index_entries = i; } } @@ -2012,8 +2012,8 @@ int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags) { timestamp = wrap_timestamp(st, timestamp); - return ff_add_index_entry(&st->internal->index_entries, &st->internal->nb_index_entries, - &st->internal->index_entries_allocated_size, pos, + return ff_add_index_entry(&st->index_entries, &st->nb_index_entries, + &st->index_entries_allocated_size, pos, timestamp, size, distance, flags); } @@ -2089,13 +2089,13 @@ void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance) if (ist1 == ist2) continue; - for (i1 = i2 = 0; i1 < st1->internal->nb_index_entries; i1++) { - AVIndexEntry *e1 = &st1->internal->index_entries[i1]; + for (i1 = i2 = 0; i1 < st1->nb_index_entries; i1++) { + AVIndexEntry *e1 = &st1->index_entries[i1]; int64_t e1_pts = av_rescale_q(e1->timestamp, st1->time_base, AV_TIME_BASE_Q); skip = FFMAX(skip, e1->size); - for (; i2 < st2->internal->nb_index_entries; i2++) { - AVIndexEntry *e2 = &st2->internal->index_entries[i2]; + for (; i2 < st2->nb_index_entries; i2++) { + AVIndexEntry *e2 = &st2->index_entries[i2]; int64_t e2_pts = av_rescale_q(e2->timestamp, st2->time_base, AV_TIME_BASE_Q); if (e2_pts < e1_pts || e2_pts - (uint64_t)e1_pts < time_tolerance) continue; @@ -2127,7 +2127,7 @@ void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance) int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, int flags) { - return ff_index_search_timestamp(st->internal->index_entries, st->internal->nb_index_entries, + return ff_index_search_timestamp(st->index_entries, st->nb_index_entries, wanted_timestamp, flags); } @@ -2160,7 +2160,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, pos_limit = -1; // GCC falsely says it may be uninitialized. st = s->streams[stream_index]; - if (st->internal->index_entries) { + if (st->index_entries) { AVIndexEntry *e; /* FIXME: Whole function must be checked for non-keyframe entries in @@ -2168,7 +2168,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, index = av_index_search_timestamp(st, target_ts, flags | AVSEEK_FLAG_BACKWARD); index = FFMAX(index, 0); - e = &st->internal->index_entries[index]; + e = &st->index_entries[index]; if (e->timestamp <= target_ts || e->pos == e->min_distance) { pos_min = e->pos; @@ -2181,9 +2181,9 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, index = av_index_search_timestamp(st, target_ts, flags & ~AVSEEK_FLAG_BACKWARD); - av_assert0(index < st->internal->nb_index_entries); + av_assert0(index < st->nb_index_entries); if (index >= 0) { - e = &st->internal->index_entries[index]; + e = &st->index_entries[index]; av_assert1(e->timestamp >= target_ts); pos_max = e->pos; ts_max = e->timestamp; @@ -2384,17 +2384,17 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index, index = av_index_search_timestamp(st, timestamp, flags); - if (index < 0 && st->internal->nb_index_entries && - timestamp < st->internal->index_entries[0].timestamp) + if (index < 0 && st->nb_index_entries && + timestamp < st->index_entries[0].timestamp) return -1; - if (index < 0 || index == st->internal->nb_index_entries - 1) { + if (index < 0 || index == st->nb_index_entries - 1) { AVPacket *pkt = s->internal->pkt; int nonkey = 0; - if (st->internal->nb_index_entries) { - av_assert0(st->internal->index_entries); - ie = &st->internal->index_entries[st->internal->nb_index_entries - 1]; + if (st->nb_index_entries) { + av_assert0(st->index_entries); + ie = &st->index_entries[st->nb_index_entries - 1]; if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0) return ret; ff_update_cur_dts(s, st, ie->timestamp); @@ -2432,7 +2432,7 @@ static int seek_frame_generic(AVFormatContext *s, int stream_index, if (s->iformat->read_seek) if (s->iformat->read_seek(s, stream_index, timestamp, flags) >= 0) return 0; - ie = &st->internal->index_entries[index]; + ie = &st->index_entries[index]; if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0) return ret; ff_update_cur_dts(s, st, ie->timestamp); @@ -4391,7 +4391,7 @@ static void free_stream(AVStream **pst) avcodec_free_context(&st->internal->avctx); av_bsf_free(&st->internal->bsfc); av_freep(&st->internal->priv_pts); - av_freep(&st->internal->index_entries); + av_freep(&st->index_entries); av_freep(&st->internal->probe_data.buf); av_bsf_free(&st->internal->extract_extradata.bsf); |