Fixed threaded use of MistPlayer.
This commit is contained in:
parent
21fe9a5910
commit
9a9490dee5
1 changed files with 4 additions and 2 deletions
|
@ -65,11 +65,13 @@ Socket::Connection Util::Stream::getLive(std::string streamname){
|
|||
|
||||
/// Starts a process for a VoD stream.
|
||||
Socket::Connection Util::Stream::getVod(std::string filename, std::string streamname){
|
||||
std::string name = "MistPlayer " + filename;
|
||||
static unsigned long long counter = 0;
|
||||
std::stringstream name;
|
||||
name << "MistPlayer " << (counter++);
|
||||
std::string player_bin = Util::getMyPath() + "MistPlayer";
|
||||
char* const argv[] = {(char*)player_bin.c_str(), (char*)filename.c_str(), (char*)"-s", (char*)streamname.c_str(), (char*)0};
|
||||
int fdin = -1, fdout = -1, fderr = fileno(stderr);
|
||||
Util::Procs::StartPiped(name, argv, &fdin, &fdout, &fderr);
|
||||
Util::Procs::StartPiped(name.str(), argv, &fdin, &fdout, &fderr);
|
||||
// if StartPiped fails then fdin and fdout will be unmodified (-1)
|
||||
return Socket::Connection(fdin, fdout);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue