Fix location of call to avcodec_close for old version of libavcodec

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/39/head
Michele Calgaro 3 months ago
parent 75a4ed1d3e
commit 1f8ddde027
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -290,13 +290,6 @@ void k9AviDecode::close() {
// Free the YUV frame
av_free(m_Frame);
// Close the video file
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
avformat_close_input(&m_FormatCtx);
#else
av_close_input_file(m_FormatCtx);
#endif
// Close the codec
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
avcodec_free_context(&m_CodecCtx);
@ -304,6 +297,13 @@ void k9AviDecode::close() {
avcodec_close(m_CodecCtx);
#endif
// Close the video file
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
avformat_close_input(&m_FormatCtx);
#else
av_close_input_file(m_FormatCtx);
#endif
m_opened=false;
}
}

Loading…
Cancel
Save