Unified · Split
| @@ -763,7 +763,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) · 762 unmodified lines | ||
| 763 | 763 | if (ret < 0) { |
| 764 | 764 | pkt->pts = pts_backup; |
| 765 | 765 | pkt->dts = dts_backup; |
| 766 | − } | |
| 766 | + } else | |
| 767 | + s->streams[pkt->stream_index]->nb_frames++; | |
| 767 | 768 | |
| 768 | 769 | return ret; |
| 769 | 770 | } |
| @@ -912,11 +913,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) · 142 unmodified lines | ||
| 912 | 913 | return ret; |
| 913 | 914 | #endif |
| 914 | 915 | |
| 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); | |
| 920 | 917 | } |
| 921 | 918 | |
| 922 | 919 | #define CHUNK_START 0x1000 |
| @@ -1237,8 +1234,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) · 314 unmodified lines | ||
| 1237 | 1234 | return ret; |
| 1238 | 1235 | |
| 1239 | 1236 | ret = write_packet(s, &opkt); |
| 1240 | − if (ret >= 0) | |
| 1241 | − s->streams[opkt.stream_index]->nb_frames++; | |
| 1242 | 1237 | |
| 1243 | 1238 | av_packet_unref(&opkt); |
| 1244 | 1239 | |
| @@ -1263,8 +1258,6 @@ int av_write_trailer(AVFormatContext *s) · 18 unmodified lines | ||
| 1263 | 1258 | break; |
| 1264 | 1259 | |
| 1265 | 1260 | ret = write_packet(s, &pkt); |
| 1266 | − if (ret >= 0) | |
| 1267 | − s->streams[pkt.stream_index]->nb_frames++; | |
| 1268 | 1261 | |
| 1269 | 1262 | av_packet_unref(&pkt); |
| 1270 | 1263 | |