aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/remuxing.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2020-03-31 09:23:19 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-03 20:50:49 +0200
commit8a23159797f8ab60c4e01307e94d2801149617b0 (patch)
tree80ac244becd846c4f5dac35bb9e03bbdbbcb9a61 /doc/examples/remuxing.c
parent259026b45758295d045e91b3a4456bd2c0249c47 (diff)
downloadffmpeg-8a23159797f8ab60c4e01307e94d2801149617b0.tar.gz
fftools/ffmpeg, doc/examples: Remove redundant av_packet_unref
av_interleaved_write_frame() already returns blank packets. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'doc/examples/remuxing.c')
-rw-r--r--doc/examples/remuxing.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/examples/remuxing.c b/doc/examples/remuxing.c
index fbf6de0cae..8deaca6a06 100644
--- a/doc/examples/remuxing.c
+++ b/doc/examples/remuxing.c
@@ -163,11 +163,13 @@ int main(int argc, char **argv)
log_packet(ofmt_ctx, &pkt, "out");
ret = av_interleaved_write_frame(ofmt_ctx, &pkt);
+ /* pkt is now blank (av_interleaved_write_frame() takes ownership of
+ * its contents and resets pkt), so that no unreferencing is necessary.
+ * This would be different if one used av_write_frame(). */
if (ret < 0) {
fprintf(stderr, "Error muxing packet\n");
break;
}
- av_packet_unref(&pkt);
}
av_write_trailer(ofmt_ctx);