diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-05 23:56:26 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-05 23:56:26 +0100 |
| commit | d39e59cbfff3b886af7a7d9c9c48f3f7f5928e43 (patch) | |
| tree | 605c8e2147936965e37b8938f71c8e601358d1bc /src | |
| parent | 2aee5a897a250c8834f47321aed99b9c7fbf6299 (diff) | |
A couple of fixes to hangs when over-trimming content.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/content.cc | 3 | ||||
| -rw-r--r-- | src/lib/player.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index 1ec607d39..4cdb23e83 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -36,6 +36,7 @@ using std::set; using std::list; using std::cout; using std::vector; +using std::max; using boost::shared_ptr; using libdcp::raw_convert; @@ -211,7 +212,7 @@ Content::technical_summary () const Time Content::length_after_trim () const { - return full_length() - trim_start() - trim_end(); + return max (0L, full_length() - trim_start() - trim_end()); } /** @param t A time relative to the start of this content (not the position). diff --git a/src/lib/player.cc b/src/lib/player.cc index 20cea7e4a..7bf78c905 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -95,7 +95,7 @@ Player::pass () } type = VIDEO; for (list<shared_ptr<Piece> >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { - if ((*i)->decoder->done ()) { + if ((*i)->decoder->done () || (*i)->content->length_after_trim() == 0) { continue; } |
