From 4bb9bef320c5dc6116c5a85cfa6898d1acc5a34e Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 31 Aug 2018 17:11:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c_wrapper/tests/test_all.cpp | 7 ++++--- src/Rtmp/FlvMuxer.cpp | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) 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){