Ignore audio streams with no codec, instead of crashing.
[dcpomatic.git] / src / lib / job.cc
index 4517765247075236bd702123852bc6125c27fc7e..95f09a4dc3fdf70eb9f1d3ad486c1026914ad77a 100644 (file)
@@ -61,6 +61,15 @@ Job::Job (shared_ptr<const Film> film)
 }
 
 Job::~Job ()
+{
+#ifdef DCPOMATIC_DEBUG
+       /* Any subclass should have called stop_thread in its destructor */
+       assert (!_thread);
+#endif
+}
+
+void
+Job::stop_thread ()
 {
        if (_thread) {
                _thread->interrupt ();
@@ -75,6 +84,7 @@ Job::~Job ()
        }
 
        delete _thread;
+       _thread = 0;
 }
 
 /** Start the job in a separate thread, returning immediately */