free the context as well.

This commit is contained in:
Isaac Connor 2020-10-08 16:46:03 -04:00
parent 871c556ac0
commit 1aadeb2206
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ FFmpeg_Input::~FFmpeg_Input() {
if ( streams ) { if ( streams ) {
for ( unsigned int i = 0; i < input_format_context->nb_streams; i += 1 ) { for ( unsigned int i = 0; i < input_format_context->nb_streams; i += 1 ) {
avcodec_close(streams[i].context); avcodec_close(streams[i].context);
streams[i].context = nullptr; avcodec_free_context(&streams[i].context);
} }
delete[] streams; delete[] streams;
streams = nullptr; streams = nullptr;