diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-09-09 00:27:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-09-09 00:27:23 +0100 |
| commit | 6ca34bc1ef59dd206379f35eb940e607a59c9804 (patch) | |
| tree | 318cf286f7e0aff5b4d0990007711d5dff6da9e5 /src/lib | |
| parent | c536ea4b470fffadcc491b2b9885e027efa2ec5c (diff) | |
Handle errors a little better when scanning for closed captions (in hints).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/hints.cc | 26 | ||||
| -rw-r--r-- | src/lib/hints.h | 2 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/hints.cc b/src/lib/hints.cc index cf14f0699..a9b9d6f54 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -273,20 +273,24 @@ Hints::thread () struct timeval last_pulse; gettimeofday (&last_pulse, 0); - while (!player->pass()) { - - struct timeval now; - gettimeofday (&now, 0); - if ((seconds(now) - seconds(last_pulse)) > 1) { - { - boost::mutex::scoped_lock lm (_mutex); - if (_stop) { - break; + try { + while (!player->pass()) { + + struct timeval now; + gettimeofday (&now, 0); + if ((seconds(now) - seconds(last_pulse)) > 1) { + { + boost::mutex::scoped_lock lm (_mutex); + if (_stop) { + break; + } } + emit (bind (boost::ref(Pulse))); + last_pulse = now; } - emit (bind (boost::ref(Pulse))); - last_pulse = now; } + } catch (...) { + store_current (); } emit (bind(boost::ref(Finished))); diff --git a/src/lib/hints.h b/src/lib/hints.h index 00c2486e7..e9a75fb14 100644 --- a/src/lib/hints.h +++ b/src/lib/hints.h @@ -30,7 +30,7 @@ class Film; -class Hints : public Signaller +class Hints : public Signaller, public ExceptionStore { public: explicit Hints (boost::weak_ptr<const Film> film); |
