Be a bit more careful with content_factory().
[dcpomatic.git] / src / wx / content_view.cc
index a020f81486f458fbad053f1b541727555cb997c4..57a5535c9bd8eb1b3d3208d77fb66ec4b19204f7 100644 (file)
 #include "lib/dcpomatic_assert.h"
 #include "lib/examine_content_job.h"
 #include "lib/job_manager.h"
-#include "lib/warnings.h"
 #include <dcp/exceptions.h>
+#include <dcp/warnings.h>
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <wx/progdlg.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::cout;
@@ -96,8 +96,11 @@ ContentView::update ()
                        shared_ptr<Content> content;
                        if (is_directory(i) && (is_regular_file(i / "ASSETMAP") || is_regular_file(i / "ASSETMAP.xml"))) {
                                content.reset (new DCPContent(i));
-                       } else if (i.path().extension() == ".mp4" || i.path().extension() == ".ecinema") {
-                               content = content_factory(i).front();
+                       } else if (i.path().extension() == ".mp4") {
+                               auto all_content = content_factory(i);
+                               if (!all_content.empty()) {
+                                       content = all_content.front();
+                               }
                        }
 
                        if (content) {