diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-04-11 13:48:50 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-04-18 00:41:27 +0200 |
commit | 00aa6dea3f3c1f15e55ba7d0dd99071065b7a3c7 (patch) | |
tree | d525fd04fbef896706e2d35599530e32396aa40c /libavformat/mux.c | |
parent | a43120b609db300a4b3fa086d6ac753c13e6bf6d (diff) | |
download | ffmpeg-00aa6dea3f3c1f15e55ba7d0dd99071065b7a3c7.tar.gz |
avformat/mux: Remove redundant resetting
Now that ff_interleave_add_packet() always returns blank packets, the
input packet to ff_interleave_packet_per_dts() will always be blank on
return as well (if supplied) and the same goes for interleave_packet()
in mux.c. Document these facts and remove the redundant resetting that
happened in av_interleaved_write_frame().
The last reference to the (long removed) destruct field that AVPackets
once had has been removed as well when updating the documentation of
ff_interleave_packet_per_dts().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index 92e5636dbe..5fc42d57b6 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1158,7 +1158,7 @@ int ff_interleaved_peek(AVFormatContext *s, int stream, /** * Interleave an AVPacket correctly so it can be muxed. * @param out the interleaved packet will be output here - * @param in the input packet + * @param in the input packet; will always be blank on return if not NULL * @param flush 1 if no further packets are available as input and all * remaining packets should be output * @return 1 if a packet was output, 0 if no packet could be output, @@ -1213,14 +1213,11 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) for (;; ) { AVPacket opkt; int ret = interleave_packet(s, &opkt, pkt, flush); - if (pkt) { - memset(pkt, 0, sizeof(*pkt)); - av_init_packet(pkt); - pkt = NULL; - } if (ret <= 0) return ret; + pkt = NULL; + ret = write_packet(s, &opkt); av_packet_unref(&opkt); |