Skip to content

Commit

Permalink
Fix for crashes when stopping recording
Browse files Browse the repository at this point in the history
  • Loading branch information
lodoyun committed Oct 21, 2013
1 parent e43851c commit 80cc895
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions erizo/src/erizo/media/ExternalOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ namespace erizo {

void ExternalOutput::closeSink() {
ELOG_DEBUG("ExternalOutput::closeSink");
if (context_!=NULL){
av_write_trailer(context_);
avformat_free_context(context_);
context_=NULL;
if (in !=NULL){
delete in;
in = NULL;
}
//avcodec_close() and avformat_free_context()
if (videoCodec_!=NULL){
Expand All @@ -103,7 +102,11 @@ namespace erizo {
free(unpackagedAudioBuffer_);
unpackagedAudioBuffer_ =NULL;
}

if (context_!=NULL){
av_write_trailer(context_);
avformat_free_context(context_);
context_=NULL;
}
ELOG_DEBUG("ExternalOutput closed Successfully");
return;
}
Expand Down

0 comments on commit 80cc895

Please sign in to comment.