mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
5c5ab88967
commit
fa5bff611d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user