Skip to content

Commit

Permalink
refine encoder code for #536.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 16, 2017
1 parent e6eafd3 commit 142a973
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions trunk/src/app/srs_app_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ int SrsEncoder::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsRequest* req, SrsConfDir
log_file += req->app;
log_file += "-";
log_file += req->stream;
if (!engine->args.empty()) {
log_file += "-";
log_file += engine->arg0();
}
log_file += ".log";
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/src/app/srs_app_ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
{
int ret = ERROR_SUCCESS;

engine_name = engine->arg0();
iformat = _srs_config->get_engine_iformat(engine);
vfilter = _srs_config->get_engine_vfilter(engine);
vcodec = _srs_config->get_engine_vcodec(engine);
Expand Down Expand Up @@ -487,7 +488,7 @@ int SrsFFMPEG::start()
// parent.
if (pid > 0) {
started = true;
srs_trace("vfored ffmpeg encoder engine, pid=%d", pid);
srs_trace("fork encoder %s, pid=%d", engine_name.c_str(), pid);
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/src/app/srs_app_ffmpeg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class SrsFFMPEG
bool fast_stopped;
pid_t pid;
private:
std::string engine_name;
std::string log_file;
private:
std::string ffmpeg;
Expand Down

0 comments on commit 142a973

Please sign in to comment.