diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-03 22:39:04 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-05 15:27:38 +0300 |
commit | fc01a703dea4fe4f2eff73480958ee6c75aa8c30 (patch) | |
tree | 8456ec63c5901d56169660692ae95b5c0d9d3a6d | |
parent | b886512ef2503fc585c302484be71475d3100480 (diff) |
fftools/ffmpeg: Avoid creating unnecessary reference
The only caller of do_video_out() doesn't need the frame afterwards,
ergo one can replace an av_frame_ref() by av_frame_move_ref().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | fftools/ffmpeg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index b0b32a69f2..855db934bf 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1138,6 +1138,7 @@ static void do_subtitle_out(OutputFile *of, } } +/* May modify/reset next_picture */ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *next_picture) @@ -1421,8 +1422,7 @@ static void do_video_out(OutputFile *of, av_frame_unref(ost->last_frame); if (next_picture) - if (av_frame_ref(ost->last_frame, next_picture) < 0) - goto error; + av_frame_move_ref(ost->last_frame, next_picture); return; error: |