aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cafdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-09 09:22:36 +0200
committerAnton Khirnov <anton@khirnov.net>2020-10-28 14:59:28 +0100
commitcea7c19cda0ea1630ae1de8c102ab14231b9db10 (patch)
tree9e703af026f15d976d79a0811566043ccb95ec9f /libavformat/cafdec.c
parent7e87288f73242dac6344e65f892569102893fac0 (diff)
downloadffmpeg-cea7c19cda0ea1630ae1de8c102ab14231b9db10.tar.gz
lavf: move AVStream.*index_entries* to AVStreamInternal
Those are private fields, no reason to have them exposed in a public header. Since there are some (semi-)public fields located after these, even though this section is supposed to be private, keep some dummy padding there until the next major bump to preserve ABI compatibility.
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r--libavformat/cafdec.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index d0f942f3e4..3bf1fa64bc 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -329,7 +329,7 @@ found_data:
if (caf->bytes_per_packet > 0 && caf->frames_per_packet > 0) {
if (caf->data_size > 0)
st->nb_frames = (caf->data_size / caf->bytes_per_packet) * caf->frames_per_packet;
- } else if (st->nb_index_entries && st->duration > 0) {
+ } else if (st->internal->nb_index_entries && st->duration > 0) {
if (st->codecpar->sample_rate && caf->data_size / st->duration > INT64_MAX / st->codecpar->sample_rate / 8) {
av_log(s, AV_LOG_ERROR, "Overflow during bit rate calculation %d * 8 * %"PRId64"\n",
st->codecpar->sample_rate, caf->data_size / st->duration);
@@ -382,13 +382,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
pkt_size = (CAF_MAX_PKT_SIZE / pkt_size) * pkt_size;
pkt_size = FFMIN(pkt_size, left);
pkt_frames = pkt_size / caf->bytes_per_packet;
- } else if (st->nb_index_entries) {
- if (caf->packet_cnt < st->nb_index_entries - 1) {
- pkt_size = st->index_entries[caf->packet_cnt + 1].pos - st->index_entries[caf->packet_cnt].pos;
- pkt_frames = st->index_entries[caf->packet_cnt + 1].timestamp - st->index_entries[caf->packet_cnt].timestamp;
- } else if (caf->packet_cnt == st->nb_index_entries - 1) {
- pkt_size = caf->num_bytes - st->index_entries[caf->packet_cnt].pos;
- pkt_frames = st->duration - st->index_entries[caf->packet_cnt].timestamp;
+ } else if (st->internal->nb_index_entries) {
+ if (caf->packet_cnt < st->internal->nb_index_entries - 1) {
+ pkt_size = st->internal->index_entries[caf->packet_cnt + 1].pos - st->internal->index_entries[caf->packet_cnt].pos;
+ pkt_frames = st->internal->index_entries[caf->packet_cnt + 1].timestamp - st->internal->index_entries[caf->packet_cnt].timestamp;
+ } else if (caf->packet_cnt == st->internal->nb_index_entries - 1) {
+ pkt_size = caf->num_bytes - st->internal->index_entries[caf->packet_cnt].pos;
+ pkt_frames = st->duration - st->internal->index_entries[caf->packet_cnt].timestamp;
} else {
return AVERROR(EIO);
}
@@ -427,10 +427,10 @@ static int read_seek(AVFormatContext *s, int stream_index,
pos = FFMIN(pos, caf->data_size);
packet_cnt = pos / caf->bytes_per_packet;
frame_cnt = caf->frames_per_packet * packet_cnt;
- } else if (st->nb_index_entries) {
+ } else if (st->internal->nb_index_entries) {
packet_cnt = av_index_search_timestamp(st, timestamp, flags);
- frame_cnt = st->index_entries[packet_cnt].timestamp;
- pos = st->index_entries[packet_cnt].pos;
+ frame_cnt = st->internal->index_entries[packet_cnt].timestamp;
+ pos = st->internal->index_entries[packet_cnt].pos;
} else {
return -1;
}