History

avformat/mux: Unify setting number of muxed packets

Andreas Rheinhardt committed 6 years ago

Commit fa5bff61 parent 5c5ab881 file · +3 −10Browse files

Unified · Split

libavformat/mux.c+3−10
@@ -763,7 +763,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) · 762 unmodified lines
763763 if (ret < 0) {
764764 pkt->pts = pts_backup;
765765 pkt->dts = dts_backup;
766− }
766+ } else
767+ s->streams[pkt->stream_index]->nb_frames++;
767768
768769 return ret;
769770 }
@@ -912,11 +913,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) · 142 unmodified lines
912913 return ret;
913914 #endif
914915
915− ret = write_packet(s, pkt);
916−
917− if (ret >= 0)
918− s->streams[pkt->stream_index]->nb_frames++;
919− return ret;
916+ return write_packet(s, pkt);
920917 }
921918
922919 #define CHUNK_START 0x1000
@@ -1237,8 +1234,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) · 314 unmodified lines
12371234 return ret;
12381235
12391236 ret = write_packet(s, &opkt);
1240− if (ret >= 0)
1241− s->streams[opkt.stream_index]->nb_frames++;
12421237
12431238 av_packet_unref(&opkt);
12441239
@@ -1263,8 +1258,6 @@ int av_write_trailer(AVFormatContext *s) · 18 unmodified lines
12631258 break;
12641259
12651260 ret = write_packet(s, &pkt);
1266− if (ret >= 0)
1267− s->streams[pkt.stream_index]->nb_frames++;
12681261
12691262 av_packet_unref(&pkt);
12701263

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t