diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-27 17:08:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-27 17:08:01 +0100 |
| commit | 409db67a7e665c562b4c46035e6394263a93a7f6 (patch) | |
| tree | 6728640477cdaf0e734948c3128a2131694352a8 /src/lib | |
| parent | 362068b534ffefcb87debd4d56b56645f3e25f21 (diff) | |
| parent | 4833c6d5dd49ecd768af5edad81823baa9c094ab (diff) | |
Merge branch 'master' of ssh://carlh.dnsalias.org/home/carl/git/dvdomatic
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cross.cc | 2 | ||||
| -rw-r--r-- | src/lib/trimmer.cc | 23 | ||||
| -rw-r--r-- | src/lib/trimmer.h | 1 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 895fb0ac2..86146c1b1 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -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 diff --git a/src/lib/trimmer.cc b/src/lib/trimmer.cc index b7afc9299..1ec9e2a5b 100644 --- a/src/lib/trimmer.cc +++ b/src/lib/trimmer.cc @@ -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; } diff --git a/src/lib/trimmer.h b/src/lib/trimmer.h index 98a118fb2..45b3f149a 100644 --- a/src/lib/trimmer.h +++ b/src/lib/trimmer.h @@ -36,5 +36,4 @@ private: int64_t _audio_start; int64_t _audio_end; int64_t _audio_in; - bool _no_trim; }; |
