完善代码

This commit is contained in:
xiongziliang 2018-08-31 17:11:39 +08:00
parent a9048b4a4d
commit 4bb9bef320
2 changed files with 5 additions and 3 deletions

View File

@ -64,12 +64,13 @@ int main(int argc,char *argv[]){
return; return;
} }
auto player = userData; auto player = userData;
media = createMedia("app","media"); media = createMedia("app","media",0,0,0);
if(player_containAudio(player) == 1){ if(player_containAudio(player) == 1){
media_initAudio(media, media_initAudio(media,
player_getAudioChannel(player), player_getAudioChannel(player),
player_getAudioSampleBit(player), player_getAudioSampleBit(player),
player_getAudioSampleRate(player)); player_getAudioSampleRate(player),
0);
} }
if(player_containVideo(player) == 1){ if(player_containVideo(player) == 1){
@ -98,7 +99,7 @@ int main(int argc,char *argv[]){
////////输入aac/////////// ////////输入aac///////////
if(media){ if(media){
media_inputAAC(media,data,len,timeStamp); media_inputAAC(media,data,len,timeStamp,1);
} }
},player); },player);

View File

@ -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) { void FlvRecorder::startRecord(const RtmpMediaSource::Ptr &media, const string &file_path) {
stop();
lock_guard<recursive_mutex> lck(_file_mtx); lock_guard<recursive_mutex> lck(_file_mtx);
//开辟文件写缓存 //开辟文件写缓存
std::shared_ptr<char> fileBuf(new char[FILE_BUF_SIZE],[](char *ptr){ std::shared_ptr<char> fileBuf(new char[FILE_BUF_SIZE],[](char *ptr){