mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
AVIDump: use avformat_free_context
This function frees all associated streams and codec contexts, and has existed since libavformat 52.96.0 (February 2011).
This commit is contained in:
@ -296,27 +296,10 @@ void AVIDump::Stop()
|
|||||||
|
|
||||||
void AVIDump::CloseVideoFile()
|
void AVIDump::CloseVideoFile()
|
||||||
{
|
{
|
||||||
if (s_stream)
|
|
||||||
{
|
|
||||||
if (s_stream->codec)
|
|
||||||
{
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
|
||||||
avcodec_default_release_buffer(s_stream->codec, s_src_frame);
|
|
||||||
#endif
|
|
||||||
avcodec_close(s_stream->codec);
|
|
||||||
}
|
|
||||||
av_freep(&s_stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
av_frame_free(&s_src_frame);
|
av_frame_free(&s_src_frame);
|
||||||
av_frame_free(&s_scaled_frame);
|
av_frame_free(&s_scaled_frame);
|
||||||
|
|
||||||
if (s_format_context)
|
avformat_free_context(s_format_context);
|
||||||
{
|
|
||||||
if (s_format_context->pb)
|
|
||||||
avio_close(s_format_context->pb);
|
|
||||||
av_freep(&s_format_context);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s_sws_context)
|
if (s_sws_context)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user