mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 04:25:58 +08:00
新增媒体流flush机制:#1996
This commit is contained in:
@@ -33,6 +33,7 @@ MP4Recorder::MP4Recorder(const string &path, const string &vhost, const string &
|
||||
}
|
||||
|
||||
MP4Recorder::~MP4Recorder() {
|
||||
flush();
|
||||
closeFile();
|
||||
}
|
||||
|
||||
@@ -96,6 +97,12 @@ void MP4Recorder::closeFile() {
|
||||
}
|
||||
}
|
||||
|
||||
void MP4Recorder::flush() {
|
||||
if (_muxer) {
|
||||
_muxer->flush();
|
||||
}
|
||||
}
|
||||
|
||||
bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
|
||||
if (!(_have_video && frame->getTrackType() == TrackAudio)) {
|
||||
//如果有视频且输入的是音频,那么应该忽略切片逻辑
|
||||
|
||||
Reference in New Issue
Block a user