summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_opt.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-19 17:29:33 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-20 00:07:47 +0100
commita132614bba247afac30d3a8b1378c40bd7f672bc (patch)
tree57d2272a40bca7cc6a494f008d79e7f8c27ecd17 /fftools/ffmpeg_opt.c
parent01923579f477ede876c1611844efa970aa928392 (diff)
fftools/ffmpeg: Avoid temporary frame
send_frame_to_filters() sends a frame to all the filters that need said frame; for every filter except the last one this involves creating a reference to the frame, because av_buffersrc_add_frame_flags() by default takes ownership of the supplied references. Yet said function has a flag which changes its behaviour to create a reference itself. This commit uses this flag and stops creating the references itself; this allows to remove the spare AVFrame holding the temporary references; it also avoids unreferencing said frame. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools/ffmpeg_opt.c')
-rw-r--r--fftools/ffmpeg_opt.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 98bd3b47b6..6732a29625 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -893,10 +893,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
if (!ist->decoded_frame)
exit_program(1);
- ist->filter_frame = av_frame_alloc();
- if (!ist->filter_frame)
- exit_program(1);
-
ist->pkt = av_packet_alloc();
if (!ist->pkt)
exit_program(1);