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

avformat/mux: Unify setting number of muxed packets

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5c5ab889
...@@ -763,7 +763,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -763,7 +763,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) { if (ret < 0) {
pkt->pts = pts_backup; pkt->pts = pts_backup;
pkt->dts = dts_backup; pkt->dts = dts_backup;
} } else
s->streams[pkt->stream_index]->nb_frames++;
return ret; return ret;
} }
...@@ -912,11 +913,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) ...@@ -912,11 +913,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
return ret; return ret;
#endif #endif
ret = write_packet(s, pkt); return write_packet(s, pkt);
if (ret >= 0)
s->streams[pkt->stream_index]->nb_frames++;
return ret;
} }
#define CHUNK_START 0x1000 #define CHUNK_START 0x1000
...@@ -1237,8 +1234,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) ...@@ -1237,8 +1234,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
return ret; return ret;
ret = write_packet(s, &opkt); ret = write_packet(s, &opkt);
if (ret >= 0)
s->streams[opkt.stream_index]->nb_frames++;
av_packet_unref(&opkt); av_packet_unref(&opkt);
...@@ -1263,8 +1258,6 @@ int av_write_trailer(AVFormatContext *s) ...@@ -1263,8 +1258,6 @@ int av_write_trailer(AVFormatContext *s)
break; break;
ret = write_packet(s, &pkt); ret = write_packet(s, &pkt);
if (ret >= 0)
s->streams[pkt.stream_index]->nb_frames++;
av_packet_unref(&pkt); av_packet_unref(&pkt);
......
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