aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-17 14:18:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-17 14:20:10 +0200
commite5cb7795fcafdf6bad58ba35161527b4a03b1122 (patch)
treea3dfbd82acdc4c2dc6205e2ee4c26ef115998d34 /libavformat/mux.c
parent5fce29ef29e416d843a139e083ae9d3f7783132a (diff)
parent324ff59444ff5470bb325ff1e2be7c4b054fc944 (diff)
downloadffmpeg-e5cb7795fcafdf6bad58ba35161527b4a03b1122.tar.gz
Merge commit '324ff59444ff5470bb325ff1e2be7c4b054fc944'
* commit '324ff59444ff5470bb325ff1e2be7c4b054fc944': avpacket: Check for and return errors in ff_interleave_add_packet() Conflicts: libavformat/audiointerleave.c libavformat/internal.h libavformat/mux.c See: 4d7c71c36467331f1e0c0f17af9f371d33308a9c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 687f7043da..308b255269 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -658,12 +658,12 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
#define CHUNK_START 0x1000
int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
- int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
+ int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
{
+ int ret;
AVPacketList **next_point, *this_pktl;
AVStream *st = s->streams[pkt->stream_index];
int chunked = s->max_chunk_size || s->max_chunk_duration;
- int ret;
this_pktl = av_mallocz(sizeof(AVPacketList));
if (!this_pktl)
@@ -681,7 +681,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
av_assert0(((AVFrame *)pkt->data)->buf);
} else {
- // duplicate the packet if it uses non-allocated memory
+ // Duplicate the packet if it uses non-allocated memory
if ((ret = av_dup_packet(&this_pktl->pkt)) < 0) {
av_free(this_pktl);
return ret;
@@ -735,6 +735,7 @@ next_non_null:
s->streams[pkt->stream_index]->last_in_packet_buffer =
*next_point = this_pktl;
+
return 0;
}
@@ -765,12 +766,12 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
AVPacket *pkt, int flush)
{
AVPacketList *pktl;
- int stream_count = 0, noninterleaved_count = 0;
+ int stream_count = 0;
+ int noninterleaved_count = 0;
int i, ret;
if (pkt) {
- ret = ff_interleave_add_packet(s, pkt, interleave_compare_dts);
- if (ret < 0)
+ if ((ret = ff_interleave_add_packet(s, pkt, interleave_compare_dts)) < 0)
return ret;
}