summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-09 00:51:31 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-09 00:51:31 +0000
commitd33a11798fc39336eb9442f11a06a9a1f2470d83 (patch)
treeac3c8b51b36eeb729eff19b2f9a017c50cd3beb9 /src/lib/player.cc
parentc2679b662dfb8c3c654e85153ef6fb552e0a218c (diff)
Fix a few memory leaks.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 53186af6e..4fbd906c6 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -452,9 +452,9 @@ Player::setup_pieces ()
if (fc) {
shared_ptr<FFmpegDecoder> fd (new FFmpegDecoder (_film, fc, _video, _audio));
- fd->Video.connect (bind (&Player::process_video, this, piece, _1, _2, _3, _4, 0));
- fd->Audio.connect (bind (&Player::process_audio, this, piece, _1, _2));
- fd->Subtitle.connect (bind (&Player::process_subtitle, this, piece, _1, _2, _3, _4));
+ fd->Video.connect (bind (&Player::process_video, this, weak_ptr<Piece> (piece), _1, _2, _3, _4, 0));
+ fd->Audio.connect (bind (&Player::process_audio, this, weak_ptr<Piece> (piece), _1, _2));
+ fd->Subtitle.connect (bind (&Player::process_subtitle, this, weak_ptr<Piece> (piece), _1, _2, _3, _4));
fd->seek (fc->time_to_content_video_frames (fc->trim_start ()), true);
piece->decoder = fd;
@@ -474,7 +474,7 @@ Player::setup_pieces ()
if (!id) {
id.reset (new StillImageDecoder (_film, ic));
- id->Video.connect (bind (&Player::process_video, this, piece, _1, _2, _3, _4, 0));
+ id->Video.connect (bind (&Player::process_video, this, weak_ptr<Piece> (piece), _1, _2, _3, _4, 0));
}
piece->decoder = id;
@@ -486,7 +486,7 @@ Player::setup_pieces ()
if (!md) {
md.reset (new MovingImageDecoder (_film, mc));
- md->Video.connect (bind (&Player::process_video, this, piece, _1, _2, _3, _4, 0));
+ md->Video.connect (bind (&Player::process_video, this, weak_ptr<Piece> (piece), _1, _2, _3, _4, 0));
}
piece->decoder = md;
@@ -495,7 +495,7 @@ Player::setup_pieces ()
shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (*i);
if (sc) {
shared_ptr<AudioDecoder> sd (new SndfileDecoder (_film, sc));
- sd->Audio.connect (bind (&Player::process_audio, this, piece, _1, _2));
+ sd->Audio.connect (bind (&Player::process_audio, this, weak_ptr<Piece> (piece), _1, _2));
piece->decoder = sd;
}