修复resetTracks情况下 MP4录制可能出现的bug

This commit is contained in:
xiongziliang 2019-10-16 11:10:20 +08:00
parent 68d29ba025
commit 3bad329f09
2 changed files with 13 additions and 0 deletions

View File

@ -153,6 +153,14 @@ void MP4Recorder::onTrackReady(const Track::Ptr & track){
}
}
void MP4Recorder::resetTracks() {
closeFile();
_tracks.clear();
_haveVideo = false;
_createFileTicker.resetTime();
MediaSink::resetTracks();
}
} /* namespace mediakit */

View File

@ -63,6 +63,11 @@ public:
const string &strApp,
const string &strStreamId);
virtual ~MP4Recorder();
/**
* Track
*/
void resetTracks() override;
private:
/**
* Track输出frameonAllTrackReady触发后才会调用此方法