@@ -1196,8 +1196,6 @@ int av_write_frame(AVFormatContext *s, AVPacket *in)
* The following avoids copying in's data unnecessarily.
* Copying side data is unavoidable as a bitstream filter
* may change it, e.g. free it on errors. */
- av_packet_unref(pkt);
- pkt->buf = NULL;
pkt->data = in->data;
pkt->size = in->size;
ret = av_packet_copy_props(pkt, in);
@@ -1240,7 +1238,6 @@ int av_write_trailer(AVFormatContext *s)
AVPacket *const pkt = s->internal->parse_pkt;
int i, ret1, ret = 0;
- av_packet_unref(pkt);
for (i = 0; i < s->nb_streams; i++) {
if (s->streams[i]->internal->bsfc) {
ret1 = write_packets_from_bsfs(s, s->streams[i], pkt, 1/*interleaved*/);
@@ -1345,7 +1342,6 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
if (!framep)
goto fail;
- av_packet_unref(pkt);
pkt->buf = av_buffer_create((void *)framep, bufsize,
uncoded_frame_free, NULL, 0);
if (!pkt->buf) {
AVFormatInternal.parse_pkt is always blank after having been used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/mux.c | 4 ---- 1 file changed, 4 deletions(-)