1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix the bug for fork ffmpeg in mac, the local variable is unvailable.

This commit is contained in:
winlin 2015-03-11 15:54:31 +08:00
parent 3e5821efff
commit a739b2c555
3 changed files with 36 additions and 24 deletions

View file

@ -432,8 +432,8 @@ int SrsFFMPEG::start()
// memory leak in child process, it's ok.
char** charpv_params = new char*[params.size() + 1];
for (int i = 0; i < (int)params.size(); i++) {
std::string p = params[i];
charpv_params[i] = (char*)p.c_str();
std::string& p = params[i];
charpv_params[i] = (char*)p.data();
}
// EOF: NULL
charpv_params[params.size()] = NULL;