Forgot to cleanup ffmpeg memory allocations in get_file_info and get_frames.

This commit is contained in:
Alf
2020-12-18 20:37:25 -08:00
parent 667ed09af8
commit 1fa33a5be3

View File

@@ -131,6 +131,7 @@ FileInfoResponse get_file_info() {
r.streams.push_back(stream); r.streams.push_back(stream);
free(fourcc); free(fourcc);
} }
avformat_close_input(&pFormatContext);
return r; return r;
} }
@@ -230,7 +231,12 @@ FramesResponse get_frames(int offset) {
} }
frame_count++; frame_count++;
} }
av_packet_unref(pPacket);
} }
avformat_close_input(&pFormatContext);
av_packet_free(&pPacket);
av_frame_free(&pFrame);
avcodec_free_context(&pCodecContext);
return r; return r;
} }