Merge branch 'master' of ssh://carlh.dnsalias.org/home/carl/git/dvdomatic
authorCarl Hetherington <cth@carlh.net>
Thu, 27 Jun 2013 16:08:01 +0000 (17:08 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 27 Jun 2013 16:08:01 +0000 (17:08 +0100)
ChangeLog
debian/changelog
src/lib/cross.cc
src/lib/trimmer.cc
src/lib/trimmer.h
src/tools/wscript
src/wx/wscript
test/trimmer_test.cc
wscript

index 09852aaecfbc3302b4bfe5bc5232436cba8464af..dd9363aacc86fcca437cb83ecd9f253bcd899d9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-06-27  Carl Hetherington  <cth@carlh.net>
+
+       * Version 0.104 released.
+
+2013-06-27  Carl Hetherington  <cth@carlh.net>
+
+       * Hopefully fix problems with end-trim not working.
+
+2013-06-24  Carl Hetherington  <cth@carlh.net>
+
+       * Version 0.103 released.
+
 2013-06-20  Carl Hetherington  <cth@carlh.net>
 
        * Version 0.102 released.
index 8e83140f58cabd5fec27db24bc32e9cfcdd013be..d12d733160a92319b69d6787f314b5b2fb8c2387 100644 (file)
@@ -1,3 +1,15 @@
+dvdomatic (0.104-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Carl Hetherington <carl@houllier.lan>  Thu, 27 Jun 2013 01:20:18 +0100
+
+dvdomatic (0.103-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Carl Hetherington <carl@houllier.lan>  Mon, 24 Jun 2013 23:39:57 +0100
+
 dvdomatic (0.102-1) UNRELEASED; urgency=low
 
   * New upstream release.
index 895fb0ac2d85cd8a2e889de6ff8f00db6a505ab7..86146c1b1797fba6387aa9d4f4bdbdaa6714d68b 100644 (file)
@@ -154,7 +154,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
        CloseHandle (process_info.hThread);
        CloseHandle (child_stderr_read);
 #else
-       string ffprobe = "ffprobe 2> \"" + content.string() + "\" 2> \"" + out.string();
+       string ffprobe = "ffprobe \"" + content.string() + "\" 2> \"" + out.string() + "\"";
        log->log (String::compose ("Probing with %1", ffprobe));
        system (ffprobe.c_str ());
 #endif 
index b7afc9299452708e6a3f4d96e44a6dc070199225..1ec9e2a5b70c6571b9646859cf5c937ff390a085 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <boost/shared_ptr.hpp>
+#include <stdint.h>
 #include "trimmer.h"
 
 using std::cout;
@@ -55,18 +56,22 @@ Trimmer::Trimmer (
                _audio_end = video_frames_to_audio_frames (_video_end, audio_sample_rate, frames_per_second);
        }
 
-       /* XXX: this is a hack; this flag means that no trim is happening at the end of the film, and I'm
-          using that to prevent audio trim being rounded to video trim, which breaks the current set
-          of regression tests.  This could be removed if a) the regression tests are regenerated and b)
-          I can work out what DCP length should be.
+       /* XXX: this is a hack; if there is no trim at the end, set
+          the audio end point to infinity so that
+          shorter-video-than-audio does not trim audio (which breaks
+          the current set of regression tests).  This could be
+          removed if a) the regression tests are regenerated and b) I
+          can work out what DCP length should be.
        */
-       _no_trim = (_video_start == 0) && (_video_end == (video_length - video_trim_end));
+       if (video_trim_end == 0) {
+               _audio_end = INT64_MAX;
+       }
 }
 
 void
 Trimmer::process_video (shared_ptr<const Image> image, bool same, shared_ptr<Subtitle> sub)
 {
-       if (_no_trim || (_video_in >= _video_start && _video_in <= _video_end)) {
+       if (_video_in >= _video_start && _video_in < _video_end) {
                Video (image, same, sub);
        }
        
@@ -76,13 +81,9 @@ Trimmer::process_video (shared_ptr<const Image> image, bool same, shared_ptr<Sub
 void
 Trimmer::process_audio (shared_ptr<const AudioBuffers> audio)
 {
-       if (_no_trim) {
-               Audio (audio);
-               return;
-       }
-       
        int64_t offset = _audio_start - _audio_in;
        if (offset > audio->frames()) {
+               /* we haven't reached the start of the untrimmed section yet */
                _audio_in += audio->frames ();
                return;
        }
index 98a118fb27abe784366efecb64bf59b4204dda23..45b3f149a3ed770840043e422c08179c1bc97db9 100644 (file)
@@ -36,5 +36,4 @@ private:
        int64_t _audio_start;
        int64_t _audio_end;
        int64_t _audio_in;
-       bool _no_trim;
 };
index 13c5d7590d799a5591205e6f5d66a19760300152..386aa452e20bb7c942a6fbb1f8d94c64805bd515 100644 (file)
@@ -6,7 +6,7 @@ import i18n
 def build(bld):
     for t in ['makedcp', 'servomatic_cli', 'servomatictest']:
         obj = bld(features = 'cxx cxxprogram')
-        obj.uselib = 'BOOST_THREAD OPENJPEG DCP AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML'
+        obj.uselib = 'BOOST_THREAD OPENJPEG DCP AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML WXWIDGETS'
         obj.includes = ['..']
         obj.use    = ['libdvdomatic']
         obj.source = '%s.cc' % t
@@ -15,7 +15,7 @@ def build(bld):
     if not bld.env.DISABLE_GUI:
         for t in ['dvdomatic', 'dvdomatic_batch', 'servomatic_gui']:
             obj = bld(features = 'cxx cxxprogram')
-            obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML'
+            obj.uselib = 'DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML WXWIDGETS'
             obj.includes = ['..']
             obj.use    = ['libdvdomatic', 'libdvdomatic-wx']
             obj.source = '%s.cc' % t
index 1c5e3b8cc33e1b22c9895704bde484697e6ed354..9213d722012e556e35380c108c83164f4f943d92 100644 (file)
@@ -25,7 +25,22 @@ sources = """
           """
 
 def configure(conf):
-    conf.check_cfg(package = '', path = conf.options.wx_config, args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True)
+    conf.check_cfg(msg='Checking for wxWidgets', package='', path=conf.options.wx_config,
+                   args='--cppflags --cxxflags --libs',
+                   uselib_store='WXWIDGETS', mandatory=True)
+    if conf.env.STATIC:
+        # wx-config returns its static libraries as full paths, without -l prefixes, which I think confuses
+        # check_cfg(), so it ends up putting these libraries before even the .cc file when linking.
+        # This hack works around that.
+        conf.env.STLIB_WXWIDGETS = ['wx_gtk2u_xrc-2.9', 'wx_gtk2u_qa-2.9', 'wx_baseu_net-2.9', 'wx_gtk2u_html-2.9',
+                                    'wx_gtk2u_adv-2.9', 'wx_gtk2u_core-2.9', 'wx_baseu_xml-2.9', 'wx_baseu-2.9']
+
+    conf.in_msg = 1
+    wx_version = conf.check_cfg(package='', path=conf.options.wx_config, args='--version').strip()
+    conf.im_msg = 0
+    if wx_version != '2.9.4':
+        conf.fatal('wxwidgets version 2.9.4 is required; %s found' % wx_version)
 
 def build(bld):
     if bld.env.STATIC:
index 605f7d1b22bc87721f0306af6f1c25f9483ed34a..ad2f2f6f53796dd1284a220b32a5eccde5b2cc97 100644 (file)
 using boost::shared_ptr;
 
 shared_ptr<const Image> trimmer_test_last_video;
+int trimmer_test_video_frames = 0;
 shared_ptr<const AudioBuffers> trimmer_test_last_audio;
 
 void
 trimmer_test_video_helper (shared_ptr<const Image> image, bool, shared_ptr<Subtitle>)
 {
        trimmer_test_last_video = image;
+       ++trimmer_test_video_frames;
 }
 
 void
@@ -92,4 +94,17 @@ BOOST_AUTO_TEST_CASE (trimmer_audio_test)
        BOOST_CHECK (trimmer_test_last_audio == 0);
 }
 
+BOOST_AUTO_TEST_CASE (trim_end_test)
+{
+       Trimmer trimmer (shared_ptr<Log> (), 0, 75, 200, 48000, 25, 25);
+
+       shared_ptr<SimpleImage> image (new SimpleImage (PIX_FMT_RGB24, libdcp::Size (256, 256), true));
 
+       trimmer.Video.connect (bind (&trimmer_test_video_helper, _1, _2, _3));
+       trimmer_test_video_frames = 0;
+       for (int i = 0; i < 200; ++i) {
+               trimmer.process_video (image, false, shared_ptr<Subtitle> ());
+       }
+
+       BOOST_CHECK_EQUAL (trimmer_test_video_frames, 125);
+}
diff --git a/wscript b/wscript
index 8088f45322441d38e7e7fe89b6d7303f2737e018..cfbaa09dd49bdf64c6856222bb7eb954b8d60936 100644 (file)
--- a/wscript
+++ b/wscript
@@ -3,7 +3,7 @@ import os
 import sys
 
 APPNAME = 'dvdomatic'
-VERSION = '0.103pre'
+VERSION = '0.105pre'
 
 def options(opt):
     opt.load('compiler_cxx')
@@ -28,7 +28,7 @@ def configure(conf):
     conf.env.TARGET_OSX = sys.platform == 'darwin'
     conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX
 
-    conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing',
+    conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-D__STDC_LIMIT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing',
                                        '-Wall', '-Wno-attributes', '-Wextra'])
 
     if conf.env.TARGET_WINDOWS: