Fix bugs in thread termination causing occasional pthread
[dcpomatic.git] / src / lib / hints.cc
index 3edceeee371bbe4978765bf0f96b2aef14dd5102..e936332a27b6465bbdadd9c9d0cfa3eb79dabc5e 100644 (file)
@@ -69,17 +69,13 @@ Hints::start ()
 
 Hints::~Hints ()
 {
-       if (!_thread.joinable()) {
-               return;
-       }
+       boost::this_thread::disable_interruption dis;
 
        try {
                _stop = true;
                _thread.interrupt ();
                _thread.join ();
-       } catch (...) {
-
-       }
+       } catch (...) {}
 }
 
 void
@@ -123,10 +119,10 @@ Hints::thread ()
        int scope = 0;
        BOOST_FOREACH (shared_ptr<const Content> i, content) {
                if (i->video) {
-                       Ratio const * r = i->video->scale().ratio ();
+                       Ratio const * r = Ratio::nearest_from_ratio(i->video->scaled_size(film->frame_size()).ratio());
                        if (r && r->id() == "239") {
                                ++scope;
-                       } else if (r && r->id() != "239" && r->id() != "190") {
+                       } else if (r && r->id() != "239" && r->id() != "235" && r->id() != "190") {
                                ++narrower_than_scope;
                        }
                }
@@ -139,7 +135,7 @@ Hints::thread ()
        }
 
        if (!scope && narrower_than_scope && film_container == "239") {
-               hint (_("All of your content is 2.35:1 or narrower but your DCP's container is Scope (2.39:1).  This will pillar-box your content.  You may prefer to set your DCP's container to have the same ratio as your content."));
+               hint (_("All of your content narrower than 1.90:1 but your DCP's container is Scope (2.39:1).  This will pillar-box your content.  You may prefer to set your DCP's container to have the same ratio as your content."));
        }
 
        if (film_container != "185" && film_container != "239" && film_container != "190") {
@@ -259,7 +255,7 @@ Hints::thread ()
 
        emit (bind(boost::ref(Progress), _("Examining closed captions")));
 
-       shared_ptr<Player> player (new Player (film, film->playlist ()));
+       shared_ptr<Player> player (new Player(film));
        player->set_ignore_video ();
        player->set_ignore_audio ();
        player->Text.connect (bind(&Hints::text, this, _1, _2, _4));