winlin

refine encoder code for #536.

@@ -299,6 +299,10 @@ int SrsEncoder::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsRequest* req, SrsConfDir @@ -299,6 +299,10 @@ int SrsEncoder::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsRequest* req, SrsConfDir
299 log_file += req->app; 299 log_file += req->app;
300 log_file += "-"; 300 log_file += "-";
301 log_file += req->stream; 301 log_file += req->stream;
  302 + if (!engine->args.empty()) {
  303 + log_file += "-";
  304 + log_file += engine->arg0();
  305 + }
302 log_file += ".log"; 306 log_file += ".log";
303 } 307 }
304 308
@@ -102,6 +102,7 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine) @@ -102,6 +102,7 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
102 { 102 {
103 int ret = ERROR_SUCCESS; 103 int ret = ERROR_SUCCESS;
104 104
  105 + engine_name = engine->arg0();
105 iformat = _srs_config->get_engine_iformat(engine); 106 iformat = _srs_config->get_engine_iformat(engine);
106 vfilter = _srs_config->get_engine_vfilter(engine); 107 vfilter = _srs_config->get_engine_vfilter(engine);
107 vcodec = _srs_config->get_engine_vcodec(engine); 108 vcodec = _srs_config->get_engine_vcodec(engine);
@@ -487,7 +488,7 @@ int SrsFFMPEG::start() @@ -487,7 +488,7 @@ int SrsFFMPEG::start()
487 // parent. 488 // parent.
488 if (pid > 0) { 489 if (pid > 0) {
489 started = true; 490 started = true;
490 - srs_trace("vfored ffmpeg encoder engine, pid=%d", pid); 491 + srs_trace("fork encoder %s, pid=%d", engine_name.c_str(), pid);
491 return ret; 492 return ret;
492 } 493 }
493 494
@@ -49,6 +49,7 @@ private: @@ -49,6 +49,7 @@ private:
49 bool fast_stopped; 49 bool fast_stopped;
50 pid_t pid; 50 pid_t pid;
51 private: 51 private:
  52 + std::string engine_name;
52 std::string log_file; 53 std::string log_file;
53 private: 54 private:
54 std::string ffmpeg; 55 std::string ffmpeg;