diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-03-12 18:54:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-03-14 18:24:04 +0100 |
commit | fa5bff611da2f628e110a2d23831ca18c076da21 (patch) | |
tree | 43e5278068ee9aefc3561d8b52b164e4f8d8fa95 /libavformat | |
parent | 5c5ab88967f0f00c5586a1fbf344aeb1166234f0 (diff) | |
download | ffmpeg-fa5bff611da2f628e110a2d23831ca18c076da21.tar.gz |
avformat/mux: Unify setting number of muxed packets
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mux.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index bc2eab0c96..bfd1bf491b 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -763,7 +763,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) if (ret < 0) { pkt->pts = pts_backup; pkt->dts = dts_backup; - } + } else + s->streams[pkt->stream_index]->nb_frames++; return ret; } @@ -912,11 +913,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) return ret; #endif - ret = write_packet(s, pkt); - - if (ret >= 0) - s->streams[pkt->stream_index]->nb_frames++; - return ret; + return write_packet(s, pkt); } #define CHUNK_START 0x1000 @@ -1237,8 +1234,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) return ret; ret = write_packet(s, &opkt); - if (ret >= 0) - s->streams[opkt.stream_index]->nb_frames++; av_packet_unref(&opkt); @@ -1263,8 +1258,6 @@ int av_write_trailer(AVFormatContext *s) break; ret = write_packet(s, &pkt); - if (ret >= 0) - s->streams[pkt.stream_index]->nb_frames++; av_packet_unref(&pkt); |