int found_moov; /* when both 'moov' and 'mdat' sections has been found */
int found_mdat; /* we suppose we have enough data to read the file */
int64_t mdat_offset;
- int total_streams;
MOVStreamContext *streams[MAX_STREAMS];
AVPaletteControl palette_control;
MOV_mdat_t *mdat_list;
chunk_size = chunk_samples * sc->bytes_per_frame / sc->samples_per_frame;
else { /* workaround to find nearest next chunk offset */
chunk_size = INT_MAX;
- for (j = 0; j < mov->total_streams; j++) {
+ for (j = 0; j < mov->fc->nb_streams; j++) {
MOVStreamContext *msc = mov->streams[j];
for (k = msc->next_chunk; k < msc->chunk_count; k++) {
if (msc->chunk_offsets[k] > current_offset && msc->chunk_offsets[k] - current_offset < chunk_size) {
chunk_size = mov->mdat_list[j].offset + mov->mdat_list[j].size - current_offset;
}
assert(chunk_size != INT_MAX);
- for (j = 0; j < mov->total_streams; j++) {
+ for (j = 0; j < mov->fc->nb_streams; j++) {
mov->streams[j]->next_chunk = 0;
}
}
}
dprintf(mov->fc, "on_parse_exit_offset=%d\n", (int) url_ftell(pb));
- mov->total_streams = s->nb_streams;
-
- for(i=0; i<mov->total_streams; i++) {
+ for(i=0; i<s->nb_streams; i++) {
MOVStreamContext *sc = mov->streams[i];
AVStream *st = s->streams[i];
/* sanity checks */
mov_build_index(mov, st);
}
- for(i=0; i<mov->total_streams; i++) {
+ for(i=0; i<s->nb_streams; i++) {
/* Do not need those anymore. */
av_freep(&mov->streams[i]->chunk_offsets);
av_freep(&mov->streams[i]->sample_to_chunk);
int64_t best_dts = INT64_MAX;
int i;
- for (i = 0; i < mov->total_streams; i++) {
+ for (i = 0; i < s->nb_streams; i++) {
MOVStreamContext *msc = mov->streams[i];
if (s->streams[i]->discard != AVDISCARD_ALL && msc->current_sample < msc->sample_count) {
AVIndexEntry *current_sample = &s->streams[i]->index_entries[msc->current_sample];
{
int i;
MOVContext *mov = s->priv_data;
- for(i=0; i<mov->total_streams; i++) {
+ for(i=0; i<s->nb_streams; i++) {
av_freep(&mov->streams[i]->ctts_data);
av_freep(&mov->streams[i]);
}