Skip to content

Commit b2ad5c6

Browse files
ssh4netlgritz
authored andcommitted
ffmpeg: Replace deprecated and soon removed avcodec_close with avcodec_free_context (#4837)
avcodec_close (AVCodecContext *avctx) removing in ffmpeg 7.2 and was deprecated for couple years Global avcodec_close (AVCodecContext *avctx) Do not use this function. Use avcodec_free_context() to destroy a codec context (either open or closed). Opening and closing a codec context multiple times is not supported anymore – use multiple codec contexts instead. In ffmpeg master, it has already been removed. But still work in v7.1 We checked the ffmpeg changelog, and avcodec_free_context was added 7 years ago and should be present in ffmpeg 4.0, the oldest version we support. Signed-off-by: Vlad (Kuzmin) Erium <[email protected]>
1 parent 904d73f commit b2ad5c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ffmpeg.imageio/ffmpeginput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ bool
599599
FFmpegInput::close(void)
600600
{
601601
if (m_codec_context)
602-
avcodec_close(m_codec_context);
602+
avcodec_free_context(&m_codec_context);
603603
if (m_format_context) {
604604
avformat_close_input(&m_format_context);
605605
av_free(m_format_context); // will free m_codec and m_codec_context

0 commit comments

Comments
 (0)