aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-11-14 22:05:55 -0300
committerJames Almer <jamrial@gmail.com>2021-11-19 11:21:04 -0300
commitee3d6a20f6e11be23f3b75924d8a853b1af241f6 (patch)
treeeaa7f039ac0bad80d78ace1614b548492c89b171 /fftools/ffmpeg.c
parent67b92d68c68bc2fac682ca3671003913498bc44c (diff)
downloadffmpeg-ee3d6a20f6e11be23f3b75924d8a853b1af241f6.tar.gz
ffmpeg: Allocate (In|Out)putStream.filter_frame early
Based on a commit by Andreas Rheinhardt. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r--fftools/ffmpeg.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 7dfcfc13f5..5a0e95bf23 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1533,9 +1533,6 @@ static int reap_filters(int flush)
if (av_buffersink_get_type(filter) == AVMEDIA_TYPE_AUDIO)
init_output_stream_wrapper(ost, NULL, 1);
- if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
- return AVERROR(ENOMEM);
- }
filtered_frame = ost->filtered_frame;
while (1) {
@@ -2342,8 +2339,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
return AVERROR(ENOMEM);
- if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
- return AVERROR(ENOMEM);
decoded_frame = ist->decoded_frame;
update_benchmark(NULL);
@@ -2415,8 +2410,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
if (!ist->decoded_frame && !(ist->decoded_frame = av_frame_alloc()))
return AVERROR(ENOMEM);
- if (!ist->filter_frame && !(ist->filter_frame = av_frame_alloc()))
- return AVERROR(ENOMEM);
decoded_frame = ist->decoded_frame;
if (ist->dts != AV_NOPTS_VALUE)
dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ist->st->time_base);