Commit f701414b authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avformat/mux: Cosmetics

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent da304e78
...@@ -928,13 +928,13 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -928,13 +928,13 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
{ {
int ret; int ret;
AVPacketList **next_point, *this_pktl; AVPacketList **next_point, *this_pktl;
AVStream *st = s->streams[pkt->stream_index]; AVStream *st = s->streams[pkt->stream_index];
int chunked = s->max_chunk_size || s->max_chunk_duration; int chunked = s->max_chunk_size || s->max_chunk_duration;
this_pktl = av_malloc(sizeof(AVPacketList)); this_pktl = av_malloc(sizeof(AVPacketList));
if (!this_pktl) if (!this_pktl)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) { if (pkt->flags & AV_PKT_FLAG_UNCODED_FRAME) {
av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE); av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
av_assert0(((AVFrame *)pkt->data)->buf); av_assert0(((AVFrame *)pkt->data)->buf);
} else { } else {
...@@ -947,7 +947,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -947,7 +947,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
av_packet_move_ref(&this_pktl->pkt, pkt); av_packet_move_ref(&this_pktl->pkt, pkt);
pkt = &this_pktl->pkt; pkt = &this_pktl->pkt;
if (s->streams[pkt->stream_index]->last_in_packet_buffer) { if (st->last_in_packet_buffer) {
next_point = &(st->last_in_packet_buffer->next); next_point = &(st->last_in_packet_buffer->next);
} else { } else {
next_point = &s->internal->packet_buffer; next_point = &s->internal->packet_buffer;
...@@ -959,8 +959,8 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -959,8 +959,8 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
st->interleaver_chunk_duration += pkt->duration; st->interleaver_chunk_duration += pkt->duration;
if ( (s->max_chunk_size && st->interleaver_chunk_size > s->max_chunk_size) if ( (s->max_chunk_size && st->interleaver_chunk_size > s->max_chunk_size)
|| (max && st->interleaver_chunk_duration > max)) { || (max && st->interleaver_chunk_duration > max)) {
st->interleaver_chunk_size = 0; st->interleaver_chunk_size = 0;
this_pktl->pkt.flags |= CHUNK_START; pkt->flags |= CHUNK_START;
if (max && st->interleaver_chunk_duration > max) { if (max && st->interleaver_chunk_duration > max) {
int64_t syncoffset = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)*max/2; int64_t syncoffset = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)*max/2;
int64_t syncto = av_rescale(pkt->dts + syncoffset, 1, max)*max - syncoffset; int64_t syncto = av_rescale(pkt->dts + syncoffset, 1, max)*max - syncoffset;
...@@ -971,7 +971,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, ...@@ -971,7 +971,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
} }
} }
if (*next_point) { if (*next_point) {
if (chunked && !(this_pktl->pkt.flags & CHUNK_START)) if (chunked && !(pkt->flags & CHUNK_START))
goto next_non_null; goto next_non_null;
if (compare(s, &s->internal->packet_buffer_end->pkt, pkt)) { if (compare(s, &s->internal->packet_buffer_end->pkt, pkt)) {
...@@ -992,8 +992,7 @@ next_non_null: ...@@ -992,8 +992,7 @@ next_non_null:
this_pktl->next = *next_point; this_pktl->next = *next_point;
s->streams[pkt->stream_index]->last_in_packet_buffer = st->last_in_packet_buffer = *next_point = this_pktl;
*next_point = this_pktl;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment