summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-05-16 14:59:50 +0200
committerCarl Hetherington <cth@carlh.net>2024-05-16 14:59:50 +0200
commiteb6f689b8e9d982d73612af2ba5ddc7ab021aec8 (patch)
treeac58fbabe3e13fa656d19543320b4a42206073dd
parent8aa25e2ec75dada5f07a3860d668241821056f61 (diff)
parent7a9cadc6fe86c74035dd971685b1acdc8f32d3fc (diff)
Merge branch 'main' into v2.17.x
-rw-r--r--cscript8
-rw-r--r--run/environment2
-rwxr-xr-xrun/tests73
-rw-r--r--src/lib/dcp_film_encoder.cc15
-rw-r--r--src/lib/ffmpeg_decoder.cc4
-rw-r--r--src/lib/player.cc81
-rw-r--r--src/lib/player.h3
-rw-r--r--src/lib/util.cc2
-rw-r--r--src/wx/supporters.cc3
-rw-r--r--src/wx/video_panel.cc4
-rw-r--r--wscript2
11 files changed, 145 insertions, 52 deletions
diff --git a/cscript b/cscript
index 67c73453b..6f7399f55 100644
--- a/cscript
+++ b/cscript
@@ -533,7 +533,7 @@ def make_spec(filename, version, target, options, requires=None):
print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
def dependencies(target, options):
- deps = [('libdcp', '9b9af8a80860210c6a29446f7a24795eeda9e7bc', {'c++17': target.platform == 'osx'})]
+ deps = [('libdcp', 'v1.9.7', {'c++17': target.platform == 'osx'})]
deps.append(('libsub', 'v1.6.47'))
deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
deps.append(('rtaudio', 'f619b76'))
@@ -935,7 +935,11 @@ def test(target, options, test):
if target.platform == 'windows':
cmd = 'run\\tests '
else:
- cmd = 'run/tests --check --log_level=test_suite '
+ cmd = 'run/tests '
+ if target.environment_prefix:
+ cmd += '-e %s ' % target.environment_prefix
+ if target.platform != 'windows':
+ cmd += ' --check --log_level=test_suite '
if target.debug:
cmd += '--backtrace '
if test is not None:
diff --git a/run/environment b/run/environment
index ddb642eed..822e0603a 100644
--- a/run/environment
+++ b/run/environment
@@ -5,6 +5,6 @@ export LD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$env/lib:/usr/local/lib64:/u
if [[ $(readlink -f $DIR/..) =~ (.*build/[^/]*) ]]; then
export LD_LIBRARY_PATH=${BASH_REMATCH[1]}/lib:$LD_LIBRARY_PATH
fi
-export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:/Users/ci/osx-environment/x86_64/10.10/lib:/Users/ci/workspace/lib
+export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:/Users/ci/workspace/lib
export DCPOMATIC_GRAPHICS=$DIR/../graphics
diff --git a/run/tests b/run/tests
index f0a764e4a..eb8b8f122 100755
--- a/run/tests
+++ b/run/tests
@@ -8,12 +8,52 @@ PRIVATE_GIT="881c48805e352dfe150993814757ca974282be18"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $DIR/environment
-if [ "$1" == "--check" ]; then
- shift 1
- check=1
-else
- check=0
-fi
+type=""
+check=0
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -e)
+ environment=$2
+ shift
+ shift
+ ;;
+ --debug)
+ type="debug"
+ shift
+ ;;
+ --backtrace)
+ type="backtrace"
+ shift
+ ;;
+ --valgrind)
+ type="valgrind"
+ shift
+ ;;
+ --callgrind)
+ type="callgrind"
+ shift
+ ;;
+ --quiet)
+ type="quiet"
+ shift
+ ;;
+ --drd)
+ type="drd"
+ shift
+ ;;
+ --helgrind)
+ type="helgrind"
+ shift
+ ;;
+ --check)
+ check=1
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
if [ "$(uname)" == "Linux" ]; then
rm -f build/test/dcpomatic2_openssl
@@ -62,27 +102,20 @@ if [ "$check" == "1" ]; then
popd
fi
-if [ "$1" == "--debug" ]; then
- shift;
+if [ "$type" == "debug" ]; then
gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
-elif [ "$1" == "--backtrace" ]; then
- shift;
+elif [ "$type" == "backtrace" ]; then
gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
-elif [ "$1" == "--valgrind" ]; then
- shift;
+elif [ "$type" == "valgrind" ]; then
# valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
-elif [ "$1" == "--callgrind" ]; then
- shift;
+elif [ "$type" == "callgrind" ]; then
valgrind --tool="callgrind" build/test/unit-tests $*
-elif [ "$1" == "--quiet" ]; then
- shift;
+elif [ "$type" == "quiet" ]; then
build/test/unit-tests --catch_system_errors=no $*
-elif [ "$1" == "--drd" ]; then
- shift;
+elif [ "$type" == "drd" ]; then
valgrind --tool="drd" build/test/unit-tests $*
-elif [ "$1" == "--helgrind" ]; then
- shift;
+elif [ "$type" == "helgrind" ]; then
valgrind --tool="helgrind" build/test/unit-tests $*
else
ulimit -c unlimited
diff --git a/src/lib/dcp_film_encoder.cc b/src/lib/dcp_film_encoder.cc
index 878ef3c6f..83da57756 100644
--- a/src/lib/dcp_film_encoder.cc
+++ b/src/lib/dcp_film_encoder.cc
@@ -124,7 +124,14 @@ DCPFilmEncoder::go()
_writer.write(_player.get_subtitle_fonts());
}
- while (!_player.pass()) {}
+ int passes = 0;
+ while (!_player.pass()) {
+ if ((++passes % 8) == 0) {
+ auto job = _job.lock();
+ DCPOMATIC_ASSERT(job);
+ job->set_progress(_player.progress());
+ }
+ }
for (auto i: get_referenced_reel_assets(_film, _film->playlist())) {
_writer.write(i);
@@ -159,10 +166,6 @@ void
DCPFilmEncoder::audio(shared_ptr<AudioBuffers> data, DCPTime time)
{
_writer.write(data, time);
-
- auto job = _job.lock ();
- DCPOMATIC_ASSERT (job);
- job->set_progress (float(time.get()) / _film->length().get());
}
void
@@ -190,5 +193,5 @@ DCPFilmEncoder::current_rate() const
Frame
DCPFilmEncoder::frames_done() const
{
- return _encoder->video_frames_enqueued();
+ return _player.frames_done();
}
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 17973d000..e80cb92e5 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -89,7 +89,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> film, shared_ptr<const FFmp
_pts_offset = {};
}
- if (c->audio) {
+ if (c->audio && !c->audio->mapping().mapped_output_channels().empty()) {
audio = make_shared<AudioDecoder>(this, c->audio, fast);
}
@@ -239,7 +239,7 @@ FFmpegDecoder::pass ()
decode_and_process_video_packet (packet);
} else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
decode_and_process_subtitle_packet (packet);
- } else {
+ } else if (audio) {
decode_and_process_audio_packet (packet);
}
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 913d7392f..9ba2f1cb0 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -685,6 +685,39 @@ Player::set_play_referenced ()
}
+pair<shared_ptr<Piece>, optional<DCPTime>>
+Player::earliest_piece_and_time() const
+{
+ auto film = _film.lock();
+ DCPOMATIC_ASSERT(film);
+
+ shared_ptr<Piece> earliest_content;
+ optional<DCPTime> earliest_time;
+
+ for (auto const& piece: _pieces) {
+ if (piece->done) {
+ continue;
+ }
+
+ auto const t = content_time_to_dcp(piece, max(piece->decoder->position(), piece->content->trim_start()));
+ if (t > piece->content->end(film)) {
+ piece->done = true;
+ } else {
+
+ /* Given two choices at the same time, pick the one with texts so we see it before
+ the video.
+ */
+ if (!earliest_time || t < *earliest_time || (t == *earliest_time && !piece->decoder->text.empty())) {
+ earliest_time = t;
+ earliest_content = piece;
+ }
+ }
+ }
+
+ return { earliest_content, earliest_time };
+}
+
+
bool
Player::pass ()
{
@@ -708,26 +741,7 @@ Player::pass ()
shared_ptr<Piece> earliest_content;
optional<DCPTime> earliest_time;
-
- for (auto i: _pieces) {
- if (i->done) {
- continue;
- }
-
- auto const t = content_time_to_dcp (i, max(i->decoder->position(), i->content->trim_start()));
- if (t > i->content->end(film)) {
- i->done = true;
- } else {
-
- /* Given two choices at the same time, pick the one with texts so we see it before
- the video.
- */
- if (!earliest_time || t < *earliest_time || (t == *earliest_time && !i->decoder->text.empty())) {
- earliest_time = t;
- earliest_content = i;
- }
- }
- }
+ std::tie(earliest_content, earliest_time) = earliest_piece_and_time();
bool done = false;
@@ -1612,3 +1626,30 @@ Player::set_disable_audio_processor()
_disable_audio_processor = true;
}
+
+Frame
+Player::frames_done() const
+{
+ auto film = _film.lock();
+ DCPOMATIC_ASSERT(film);
+
+ shared_ptr<Piece> earliest_content;
+ optional<DCPTime> earliest_time;
+ std::tie(earliest_content, earliest_time) = earliest_piece_and_time();
+
+ return earliest_time.get_value_or({}).frames_round(film->video_frame_rate());
+}
+
+
+float
+Player::progress() const
+{
+ auto film = _film.lock();
+ DCPOMATIC_ASSERT(film);
+
+ shared_ptr<Piece> earliest_content;
+ optional<DCPTime> earliest_time;
+ std::tie(earliest_content, earliest_time) = earliest_piece_and_time();
+
+ return static_cast<float>(earliest_time.get_value_or({}).get()) / film->length().get();
+}
diff --git a/src/lib/player.h b/src/lib/player.h
index 2502ae536..314031698 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -90,6 +90,8 @@ public:
bool pass ();
void seek (dcpomatic::DCPTime time, bool accurate);
+ Frame frames_done() const;
+ float progress() const;
std::vector<std::shared_ptr<dcpomatic::Font>> get_subtitle_fonts ();
@@ -157,6 +159,7 @@ private:
std::shared_ptr<PlayerVideo> black_player_video_frame (Eyes eyes) const;
void emit_video_until(dcpomatic::DCPTime time);
void insert_video(std::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time, dcpomatic::DCPTime end);
+ std::pair<std::shared_ptr<Piece>, boost::optional<dcpomatic::DCPTime>> earliest_piece_and_time() const;
void video (std::weak_ptr<Piece>, ContentVideo);
void audio (std::weak_ptr<Piece>, AudioStreamPtr, ContentAudio);
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 282011d65..172b8d763 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -848,6 +848,8 @@ audio_channel_types (list<int> mapped, int channels)
case dcp::Channel::BSR:
++non_lfe;
break;
+ case dcp::Channel::LC:
+ case dcp::Channel::RC:
case dcp::Channel::HI:
case dcp::Channel::VI:
case dcp::Channel::MOTION_DATA:
diff --git a/src/wx/supporters.cc b/src/wx/supporters.cc
index 374beb656..baeba2da9 100644
--- a/src/wx/supporters.cc
+++ b/src/wx/supporters.cc
@@ -61,6 +61,7 @@ supported_by.Add (wxT ("BFI National Archive"));
supported_by.Add (wxT ("Cristian Arias Arévalo"));
supported_by.Add (wxT ("Alex Argoitia"));
supported_by.Add (wxT ("Esteban Arrangoiz"));
+supported_by.Add (wxT ("The Boscov Theater at GoggleWorks Center for the Arts"));
supported_by.Add (wxT ("Gunnar Ásgeir Ásgeirsson"));
supported_by.Add (wxT ("Andrea Ashton"));
supported_by.Add (wxT ("Georges Asmar"));
@@ -273,6 +274,7 @@ supported_by.Add (wxT ("Greg Delmage"));
supported_by.Add (wxT ("Diemiruaya Deniran"));
supported_by.Add (wxT ("Larin Denis"));
supported_by.Add (wxT ("Michael Denner"));
+supported_by.Add (wxT ("denverdisc.com"));
supported_by.Add (wxT ("Nicholas Deppe"));
supported_by.Add (wxT ("Alexey Derevyanko"));
supported_by.Add (wxT ("Olivier Dermine"));
@@ -553,6 +555,7 @@ supported_by.Add (wxT ("Mason Hunsicker"));
supported_by.Add (wxT ("Markus Hüsgen"));
supported_by.Add (wxT ("Maurice Huvelin"));
supported_by.Add (wxT ("Robin Hyden"));
+supported_by.Add (wxT ("IAFilm"));
supported_by.Add (wxT ("Dayton Movies Inc"));
supported_by.Add (wxT ("Buttons Sound Inc"));
supported_by.Add (wxT ("Paramount Twin Inc"));
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 5a91df8fe..65f381fe3 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -100,7 +100,11 @@ VideoPanel::create ()
int const link_height = 32;
#elif defined(DCPOMATIC_OSX)
int const crop_width = 56;
+#if wxCHECK_VERSION(3, 2, 0)
int const link_width = 8 + 15 / dpi_scale_factor(this);
+#else
+ int const link_width = 23;
+#endif
int const link_height = 28;
#else
int const crop_width = 56;
diff --git a/wscript b/wscript
index c5996a361..0fae054bf 100644
--- a/wscript
+++ b/wscript
@@ -35,7 +35,7 @@ except ImportError:
from waflib import Logs, Context
APPNAME = 'dcpomatic'
-libdcp_version = '1.8.73'
+libdcp_version = '1.8.100'
libsub_version = '1.6.42'
this_version = subprocess.Popen(['git', 'tag', '-l', '--points-at', 'HEAD'], stdout=subprocess.PIPE).communicate()[0]