diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-31 15:44:51 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-31 15:44:51 +0000 |
| commit | ad49361b303d1ceff7048fa0e89ba609ca9ce376 (patch) | |
| tree | be6413325604b0d403add54a8de6ea861ec90772 /src/lib/encoder.cc | |
| parent | b2a9271256e09fcfedff3beea5fc73c04e7c0e14 (diff) | |
| parent | 5625ba9542e38504e87799dd655be5071161fb1f (diff) | |
Merge 1.0
Diffstat (limited to 'src/lib/encoder.cc')
| -rw-r--r-- | src/lib/encoder.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 475c230da..ca9134c04 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -96,7 +96,6 @@ Encoder::process_begin () ServerFinder::instance()->connect (boost::bind (&Encoder::server_found, this, _1)); } - void Encoder::process_end () { @@ -199,9 +198,12 @@ Encoder::process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversi return; } - if (_writer->thrown ()) { - _writer->rethrow (); - } + _writer->rethrow (); + /* Re-throw any exception raised by one of our threads. If more + than one has thrown an exception, only one will be rethrown, I think; + but then, if that happens something has gone badly wrong. + */ + rethrow (); if (_writer->can_fake_write (_video_frames_out)) { _writer->fake_write (_video_frames_out, eyes); @@ -257,6 +259,7 @@ Encoder::terminate_threads () void Encoder::encoder_thread (optional<ServerDescription> server) +try { /* Number of seconds that we currently wait between attempts to connect to the server; not relevant for localhost @@ -338,6 +341,10 @@ Encoder::encoder_thread (optional<ServerDescription> server) _condition.notify_all (); } } +catch (...) +{ + store_current (); +} void Encoder::server_found (ServerDescription s) |
