summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-31 00:25:06 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-31 00:25:06 +0000
commita5d5ceb22c4f5dd3e6c5b7a8da76f724dd266a75 (patch)
tree240afbdffe8cc59aec2b87fe323936dbc3749055 /src/lib
parentca7a6e8f81ccb3cba1160c5dff9dd3b5749c29ca (diff)
Fix sequencing failure in some very specific circumstances.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc5
-rw-r--r--src/lib/player_video.cc18
-rw-r--r--src/lib/player_video.h2
3 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 3d5762740..9ee8ab72c 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -715,8 +715,9 @@ Player::video (weak_ptr<Piece> wp, ContentVideo video)
}
while (j < time || eyes != video.eyes) {
if (last != _last_video.end()) {
- last->second->set_eyes (eyes);
- emit_video (last->second, j);
+ shared_ptr<PlayerVideo> copy = last->second->shallow_copy();
+ copy->set_eyes (eyes);
+ emit_video (copy, j);
} else {
emit_video (black_player_video_frame(eyes), j);
}
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index d3f09947e..8ff008b39 100644
--- a/src/lib/player_video.cc
+++ b/src/lib/player_video.cc
@@ -258,3 +258,21 @@ PlayerVideo::memory_used () const
{
return _in->memory_used();
}
+
+/** @return Shallow copy of this; _in and _subtitle are shared between the original and the copy */
+shared_ptr<PlayerVideo>
+PlayerVideo::shallow_copy () const
+{
+ return shared_ptr<PlayerVideo>(
+ new PlayerVideo(
+ _in,
+ _crop,
+ _fade,
+ _inter_size,
+ _out_size,
+ _eyes,
+ _part,
+ _colour_conversion
+ )
+ );
+}
diff --git a/src/lib/player_video.h b/src/lib/player_video.h
index fe7ae384e..a6e39d66e 100644
--- a/src/lib/player_video.h
+++ b/src/lib/player_video.h
@@ -55,6 +55,8 @@ public:
PlayerVideo (boost::shared_ptr<cxml::Node>, boost::shared_ptr<Socket>);
+ boost::shared_ptr<PlayerVideo> shallow_copy () const;
+
void set_subtitle (PositionImage);
void prepare ();