//calculate dts from pts
if (pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
- st->pts_buffer[0] = pkt->pts;
- for (i = 1; i < delay + 1 && st->pts_buffer[i] == AV_NOPTS_VALUE; i++)
- st->pts_buffer[i] = pkt->pts + (i - delay - 1) * pkt->duration;
- for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
- FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
+ st->internal->pts_buffer[0] = pkt->pts;
+ for (i = 1; i < delay + 1 && st->internal->pts_buffer[i] == AV_NOPTS_VALUE; i++)
+ st->internal->pts_buffer[i] = pkt->pts + (i - delay - 1) * pkt->duration;
+ for (i = 0; i<delay && st->internal->pts_buffer[i] > st->internal->pts_buffer[i + 1]; i++)
+ FFSWAP(int64_t, st->internal->pts_buffer[i], st->internal->pts_buffer[i + 1]);
- pkt->dts = st->pts_buffer[0];
+ pkt->dts = st->internal->pts_buffer[0];
}
if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
av_packet_move_ref(&this_pktl->pkt, pkt);
pkt = &this_pktl->pkt;
- if (st->last_in_packet_buffer) {
- next_point = &(st->last_in_packet_buffer->next);
+ if (st->internal->last_in_packet_buffer) {
+ next_point = &(st->internal->last_in_packet_buffer->next);
} else {
next_point = &s->internal->packet_buffer;
}
if (chunked) {
uint64_t max= av_rescale_q_rnd(s->max_chunk_duration, AV_TIME_BASE_Q, st->time_base, AV_ROUND_UP);
- st->interleaver_chunk_size += pkt->size;
- st->interleaver_chunk_duration += pkt->duration;
- if ( (s->max_chunk_size && st->interleaver_chunk_size > s->max_chunk_size)
- || (max && st->interleaver_chunk_duration > max)) {
- st->interleaver_chunk_size = 0;
+ st->internal->interleaver_chunk_size += pkt->size;
+ st->internal->interleaver_chunk_duration += pkt->duration;
+ if ( (s->max_chunk_size && st->internal->interleaver_chunk_size > s->max_chunk_size)
+ || (max && st->internal->interleaver_chunk_duration > max)) {
+ st->internal->interleaver_chunk_size = 0;
pkt->flags |= CHUNK_START;
- if (max && st->interleaver_chunk_duration > max) {
+ if (max && st->internal->interleaver_chunk_duration > max) {
int64_t syncoffset = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)*max/2;
int64_t syncto = av_rescale(pkt->dts + syncoffset, 1, max)*max - syncoffset;
- st->interleaver_chunk_duration += (pkt->dts - syncto)/8 - max;
+ st->internal->interleaver_chunk_duration += (pkt->dts - syncto)/8 - max;
} else
- st->interleaver_chunk_duration = 0;
+ st->internal->interleaver_chunk_duration = 0;
}
}
if (*next_point) {
this_pktl->next = *next_point;
- st->last_in_packet_buffer = *next_point = this_pktl;
+ st->internal->last_in_packet_buffer = *next_point = this_pktl;
return 0;
}
}
for (i = 0; i < s->nb_streams; i++) {
- if (s->streams[i]->last_in_packet_buffer) {
+ if (s->streams[i]->internal->last_in_packet_buffer) {
++stream_count;
} else if (s->streams[i]->codecpar->codec_type != AVMEDIA_TYPE_ATTACHMENT &&
s->streams[i]->codecpar->codec_id != AV_CODEC_ID_VP8 &&
for (i = 0; i < s->nb_streams; i++) {
int64_t last_dts;
- const AVPacketList *last = s->streams[i]->last_in_packet_buffer;
+ const AVPacketList *last = s->streams[i]->internal->last_in_packet_buffer;
if (!last)
continue;
if (!s->internal->packet_buffer)
s->internal->packet_buffer_end = NULL;
- if (st->last_in_packet_buffer == pktl)
- st->last_in_packet_buffer = NULL;
+ if (st->internal->last_in_packet_buffer == pktl)
+ st->internal->last_in_packet_buffer = NULL;
av_packet_unref(&pktl->pkt);
av_freep(&pktl);
if (!s->internal->packet_buffer)
s->internal->packet_buffer_end = NULL;
- if (st->last_in_packet_buffer == pktl)
- st->last_in_packet_buffer = NULL;
+ if (st->internal->last_in_packet_buffer == pktl)
+ st->internal->last_in_packet_buffer = NULL;
av_freep(&pktl);
return 1;
ret = s->pb ? s->pb->error : 0;
for (i = 0; i < s->nb_streams; i++) {
av_freep(&s->streams[i]->priv_data);
- av_freep(&s->streams[i]->index_entries);
+ av_freep(&s->streams[i]->internal->index_entries);
}
if (s->oformat->priv_class)
av_opt_free(s->priv_data);