test fix crashes

This commit is contained in:
Isaac Connor 2017-08-11 08:02:02 -04:00
parent cc28af8ed2
commit 5589b318a3
1 changed files with 6 additions and 5 deletions

View File

@ -377,12 +377,12 @@ VideoStore::~VideoStore(){
// What if we were only doing audio recording? // What if we were only doing audio recording?
if ( video_output_stream ) { if ( video_output_stream ) {
avcodec_close(video_output_context); avcodec_close(video_output_context);
av_free(video_output_context); //av_free(video_output_context);
video_output_context = NULL; video_output_context = NULL;
} }
if (audio_output_stream) { if (audio_output_stream) {
avcodec_close(audio_output_context); avcodec_close(audio_output_context);
av_free(audio_output_context); //av_free(audio_output_context);
audio_output_context = NULL; audio_output_context = NULL;
#ifdef HAVE_LIBAVRESAMPLE #ifdef HAVE_LIBAVRESAMPLE
if ( resample_context ) { if ( resample_context ) {
@ -402,9 +402,6 @@ VideoStore::~VideoStore(){
Debug(3, "Not closing avio because we are not writing to a file."); Debug(3, "Not closing avio because we are not writing to a file.");
} }
/* free the stream */
avformat_free_context(oc);
if ( input_frame ) { if ( input_frame ) {
av_frame_free( &input_frame ); av_frame_free( &input_frame );
input_frame = NULL; input_frame = NULL;
@ -413,6 +410,10 @@ VideoStore::~VideoStore(){
av_frame_free( &output_frame ); av_frame_free( &output_frame );
output_frame = NULL; output_frame = NULL;
} }
/* free the stream */
avformat_free_context(oc);
} }
bool VideoStore::setup_resampler() { bool VideoStore::setup_resampler() {