Skip to content

Commit

Permalink
Merge pull request #187 from ethouris/dev-fix-crashonkill
Browse files Browse the repository at this point in the history
Put creation under execption catch.
  • Loading branch information
rndi committed Dec 8, 2017
2 parents 085efe7 + 2ee1d30 commit d3be894
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions apps/srt-live-transmit.cpp
Expand Up @@ -298,8 +298,25 @@ int main( int argc, char** argv )
signal(SIGINT, OnINT_SetIntState);
signal(SIGTERM, OnINT_SetIntState);

auto src = Source::Create(params[0]);
auto tar = Target::Create(params[1]);
unique_ptr<Source> src;
unique_ptr<Target> tar;

try
{
src = Source::Create(params[0]);
tar = Target::Create(params[1]);
}
catch(std::exception& x)
{
if ( transmit_verbose )
{
cout << "MEDIA CREATION FAILED: " << x.what() << " - exitting";
}

// Don't speak anything when no -v option.
// (the "requested interrupt" will be printed anyway)
return 2;
}

// Now loop until broken
BandwidthGuard bw(bandwidth);
Expand Down

0 comments on commit d3be894

Please sign in to comment.