diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-08-13 17:37:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-08-14 00:05:06 +0100 |
| commit | 1fe6bd7f8ba059322b8357b2210f0fd590567ce2 (patch) | |
| tree | 2c76fbf24b9b520f94f741040f11dc920d3bab91 /src/lib/content_part.h | |
| parent | f30ad4dec0a3fa5f1770fba93106a3e8910d66ba (diff) | |
More fixes for errors / crashes / misbehaviour with content changes
and the butler.
Here we signal both before and after a change in content. Before,
the player disables itself so that any pass()/seek() will be no-ops.
After, the player rebuilds its pieces and the butler re-seeks to
get back to where it was before the change.
Diffstat (limited to 'src/lib/content_part.h')
| -rw-r--r-- | src/lib/content_part.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/content_part.h b/src/lib/content_part.h index 4f6e9e396..58833655f 100644 --- a/src/lib/content_part.h +++ b/src/lib/content_part.h @@ -23,6 +23,7 @@ #define DCPOMATIC_CONTENT_PART_H #include "content.h" +#include "content_change.h" #include <boost/weak_ptr.hpp> #include <boost/thread/mutex.hpp> @@ -41,28 +42,30 @@ protected: void maybe_set (T& member, T new_value, int property) const { + ContentChange cc (_parent, property); { boost::mutex::scoped_lock lm (_mutex); if (member == new_value) { + cc.abort (); return; } member = new_value; } - _parent->signal_changed (property); } template <class T> void maybe_set (boost::optional<T>& member, T new_value, int property) const { + ContentChange cc (_parent, property); { boost::mutex::scoped_lock lm (_mutex); if (member && member.get() == new_value) { + cc.abort (); return; } member = new_value; } - _parent->signal_changed (property); } Content* _parent; |
