Merge branch 'master' into wx
authorCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 22:37:32 +0000 (23:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 24 Jul 2012 22:37:32 +0000 (23:37 +0100)
rebuild-windows
src/lib/film_state.h
src/lib/make_dcp_job.cc

index 3424d7451834118af9b64df466c23b70ec323425..60b4f29ff4dd05a9d61637c5cc515f1ec280ecb8 100755 (executable)
@@ -8,12 +8,21 @@ export WINDOWS_PREFIX="/home/carl/src/windows"
 export PKG_CONFIG_LIBDIR=$WINDOWS_PREFIX/lib/pkgconfig
 
 ./waf clean
+
 export PATH=$WINDOWS_PREFIX/bin:$PATH
+
 CXX=$MINGW_CXX WINRC=$MINGW_WINDRES \
   CXXFLAGS="-I$WINDOWS_PREFIX/include -I$MINGW_PREFIX/include" \
   LINKFLAGS="-L$WINDOWS_PREFIX/lib -L$MINGW_PREFIX/lib" \
   ./waf configure --target-windows
+if [ "$?" != "0" ]; then
+  exit 1
+fi
+
 ./waf
+if [ "$?" != "0" ]; then
+  exit 1
+fi
 
 d=`pwd`
 
index beac5fc2c92410fca665a7a4085bae04f7661076..3a547ed1d141b0a5b6afaf546829acf1dbd75caf 100644 (file)
@@ -139,7 +139,7 @@ public:
        std::vector<int> thumbs;
        /** Size, in pixels, of the source (ignoring cropping) */
        Size size;
-       /** Length in frames */
+       /** Length of the source in frames */
        int length;
        /** Number of audio channels */
        int audio_channels;
index 3de5e8d5db1136ab3055d3a65dd04f3c08c25d20..a6d0c2d10a1ed755d52d71a2b2af27d2fc2a6de3 100644 (file)
@@ -31,6 +31,7 @@ extern "C" {
 #include "dcp_content_type.h"
 #include "exceptions.h"
 #include "options.h"
+#include "imagemagick_decoder.h"
 
 using namespace std;
 using namespace boost;
@@ -73,7 +74,16 @@ MakeDCPJob::run ()
        /* Remove any old DCP */
        filesystem::remove_all (dcp_path);
 
-       int const frames = _fs->dcp_frames ? _fs->dcp_frames : _fs->length;
+       int frames = 0;
+       switch (_fs->content_type ()) {
+       case VIDEO:
+               frames = _fs->dcp_frames ? _fs->dcp_frames : _fs->length;
+               break;
+       case STILL:
+               frames = _fs->still_duration * ImageMagickDecoder::static_frames_per_second ();
+               break;
+       }
+       
        libdcp::DCP dcp (_fs->dir (_fs->name), _fs->name, _fs->dcp_content_type->libdcp_type (), rint (_fs->frames_per_second), frames);
        dcp.Progress.connect (sigc::mem_fun (*this, &MakeDCPJob::dcp_progress));