diff --git a/c_wrapper/tests/test_all.cpp b/c_wrapper/tests/test_all.cpp index 8db1df99..67f8cfff 100644 --- a/c_wrapper/tests/test_all.cpp +++ b/c_wrapper/tests/test_all.cpp @@ -64,12 +64,13 @@ int main(int argc,char *argv[]){ return; } auto player = userData; - media = createMedia("app","media"); + media = createMedia("app","media",0,0,0); if(player_containAudio(player) == 1){ media_initAudio(media, player_getAudioChannel(player), player_getAudioSampleBit(player), - player_getAudioSampleRate(player)); + player_getAudioSampleRate(player), + 0); } if(player_containVideo(player) == 1){ @@ -98,7 +99,7 @@ int main(int argc,char *argv[]){ ////////输入aac/////////// if(media){ - media_inputAAC(media,data,len,timeStamp); + media_inputAAC(media,data,len,timeStamp,1); } },player); diff --git a/src/Rtmp/FlvMuxer.cpp b/src/Rtmp/FlvMuxer.cpp index 536ddc11..16a9d177 100644 --- a/src/Rtmp/FlvMuxer.cpp +++ b/src/Rtmp/FlvMuxer.cpp @@ -173,6 +173,7 @@ void FlvRecorder::startRecord(const string &vhost, const string &app, const stri } void FlvRecorder::startRecord(const RtmpMediaSource::Ptr &media, const string &file_path) { + stop(); lock_guard lck(_file_mtx); //开辟文件写缓存 std::shared_ptr fileBuf(new char[FILE_BUF_SIZE],[](char *ptr){