summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-10 14:50:45 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-10 14:50:45 +0100
commit6b9bda07984837d188064f3f5514d0aa132655ec (patch)
treeea47f81ed495934372f57a96b895f93fdb29a04c
parentc9a97108df1d609bd13df8a21bee11d7ca55feea (diff)
Use more direct route to fix hangs after calling some Player methods.
-rw-r--r--src/lib/player.cc53
-rw-r--r--src/lib/player.h3
2 files changed, 15 insertions, 41 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 41cf52f2c..4ee7d9359 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -83,9 +83,6 @@ int const PlayerProperty::PLAYLIST = 701;
int const PlayerProperty::FILM_CONTAINER = 702;
int const PlayerProperty::FILM_VIDEO_FRAME_RATE = 703;
int const PlayerProperty::DCP_DECODE_REDUCTION = 704;
-int const PlayerProperty::IGNORE_COMPONENTS = 705;
-int const PlayerProperty::FAST = 706;
-int const PlayerProperty::PLAY_REFERENCED = 707;
Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist)
: _film (film)
@@ -468,37 +465,25 @@ Player::get_subtitle_fonts ()
void
Player::set_ignore_video ()
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _ignore_video = true;
- _have_valid_pieces = false;
- }
-
- Changed (PlayerProperty::IGNORE_COMPONENTS, false);
+ boost::mutex::scoped_lock lm (_mutex);
+ _ignore_video = true;
+ setup_pieces ();
}
void
Player::set_ignore_audio ()
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _ignore_audio = true;
- _have_valid_pieces = false;
- }
-
- Changed (PlayerProperty::IGNORE_COMPONENTS, false);
+ boost::mutex::scoped_lock lm (_mutex);
+ _ignore_audio = true;
+ setup_pieces ();
}
void
Player::set_ignore_text ()
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _ignore_text = true;
- _have_valid_pieces = false;
- }
-
- Changed (PlayerProperty::IGNORE_COMPONENTS, false);
+ boost::mutex::scoped_lock lm (_mutex);
+ _ignore_text = true;
+ setup_pieces ();
}
/** Set the player to always burn open texts into the image regardless of the content settings */
@@ -513,25 +498,17 @@ Player::set_always_burn_open_subtitles ()
void
Player::set_fast ()
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _fast = true;
- _have_valid_pieces = false;
- }
-
- Changed (PlayerProperty::FAST, false);
+ boost::mutex::scoped_lock lm (_mutex);
+ _fast = true;
+ setup_pieces ();
}
void
Player::set_play_referenced ()
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _play_referenced = true;
- _have_valid_pieces = false;
- }
-
- Changed (PlayerProperty::PLAY_REFERENCED, false);
+ boost::mutex::scoped_lock lm (_mutex);
+ _play_referenced = true;
+ setup_pieces ();
}
list<ReferencedReelAsset>
diff --git a/src/lib/player.h b/src/lib/player.h
index c6e657d16..20b68ef77 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -56,9 +56,6 @@ public:
static int const FILM_CONTAINER;
static int const FILM_VIDEO_FRAME_RATE;
static int const DCP_DECODE_REDUCTION;
- static int const IGNORE_COMPONENTS;
- static int const FAST;
- static int const PLAY_REFERENCED;
};
/** @class Player