summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-05-16 14:57:06 +0200
committerCarl Hetherington <cth@carlh.net>2024-05-16 14:57:06 +0200
commita4930f8185f2d3f3a9dc93b938792fae758be4d7 (patch)
treef3813d7b4be91718edfc73ad45aba46447b3e99c
parent9b9af8a80860210c6a29446f7a24795eeda9e7bc (diff)
parent47b82590f5d1538b599e323daa5e0c792e4d4695 (diff)
Merge branch 'main' into v1.9.xv1.9.7
-rw-r--r--cscript2
-rwxr-xr-xrun/tests39
-rw-r--r--src/types.cc6
-rw-r--r--src/types.h3
-rw-r--r--test/cpl_metadata_test.cc24
-rw-r--r--test/stream_operators.cc6
6 files changed, 70 insertions, 10 deletions
diff --git a/cscript b/cscript
index 495bec31..bec2a383 100644
--- a/cscript
+++ b/cscript
@@ -99,6 +99,8 @@ def make_doxygen(target):
def test(target, options, test):
target.set('LC_ALL', 'C')
cmd = 'run\\tests ' if target.platform == 'windows' else 'run/tests '
+ if target.environment_prefix:
+ cmd += '-e %s' % target.environment_prefix
if test is not None:
cmd += '-t %s' % test
target.command(cmd)
diff --git a/run/tests b/run/tests
index f3b43666..f4e8d405 100755
--- a/run/tests
+++ b/run/tests
@@ -10,9 +10,35 @@ work=build/test
dcpinfo=build/tools/dcpinfo
dcpverify=build/tools/dcpverify
+type=""
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -e)
+ environment=$2
+ shift
+ shift
+ ;;
+ --debug)
+ type="debug"
+ shift
+ ;;
+ --valgrind)
+ type="valgrind"
+ shift
+ ;;
+ --callgrind)
+ type="callgrind"
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
export LD_LIBRARY_PATH=build/src:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
# SIP stops this being passed in from the caller's environment
-export DYLD_LIBRARY_PATH=/Users/ci/osx-environment/x86_64/10.10/lib:/Users/ci/workspace/lib
+export DYLD_LIBRARY_PATH=$environment/x86_64/10.10/lib:/Users/ci/workspace/lib
export LIBDCP_RESOURCES=.
# Make sure we have the required tools
@@ -23,14 +49,11 @@ done
echo "--- Unit tests"
# Run the unit tests in test/
-if [ "$1" == "--debug" ]; then
- shift
+if [ "$type" == "debug" ]; then
gdb --args $work/tests $private $*
-elif [ "$1" == "--valgrind" ]; then
- shift
+elif [ "$type" == "valgrind" ]; then
valgrind --tool="memcheck" $work/tests $private $*
-elif [ "$1" == "--callgrind" ]; then
- shift
+elif [ "$type" == "callgrind" ]; then
valgrind --tool="callgrind" $work/tests $private $*
else
$work/tests $* -- $private
@@ -150,7 +173,7 @@ fi
$dcpinfo -s $private/data/JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV >> $work/jah.log
# Parse some problematic subs and check that we get it right
-run/test/subs_in_out $private/TunaBoat_Icelandic_Reel1_V1_8sec.xml > $work/tuna.xml
+build/test/subs_in_out $private/TunaBoat_Icelandic_Reel1_V1_8sec.xml > $work/tuna.xml
diff -q $private/TunaBoat_Icelandic_Reel1_V1_8sec.parsed.xml $work/tuna.xml
if [ "$?" != "0" ]; then
echo "FAIL: output of parse check 1 invalid"
diff --git a/src/types.cc b/src/types.cc
index c4ba8886..d58256a5 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -547,11 +547,15 @@ dcp::mca_id_to_channel (string id)
return Channel::HI;
} else if (id == "vin" || id == "vi-n") {
return Channel::VI;
+ } else if (id == "lc") {
+ return Channel::LC;
+ } else if (id == "rc") {
+ return Channel::RC;
} else if (id == "lrs" || id == "lsr") {
return Channel::BSL;
} else if (id == "rrs" || id == "rsr") {
return Channel::BSR;
- } else if (id == "dbox") {
+ } else if (id == "dbox" || id == "mtn") {
return Channel::MOTION_DATA;
} else if (id == "sync" || id == "fsksync") {
return Channel::SYNC_SIGNAL;
diff --git a/src/types.h b/src/types.h
index 183ce638..65840e6d 100644
--- a/src/types.h
+++ b/src/types.h
@@ -99,7 +99,8 @@ enum class Channel {
RS = 5, ///< right surround
HI = 6,
VI = 7,
- /* 8 and 9 are not used */
+ LC = 8, ///< not used, but referred to in MainSoundConfiguration in some CPLs
+ RC = 9, ///< not used, but referred to in MainSoundConfiguration in some CPLs
BSL = 10,
BSR = 11,
MOTION_DATA = 12,
diff --git a/test/cpl_metadata_test.cc b/test/cpl_metadata_test.cc
index a811e56f..906f1bc4 100644
--- a/test/cpl_metadata_test.cc
+++ b/test/cpl_metadata_test.cc
@@ -154,6 +154,30 @@ BOOST_AUTO_TEST_CASE (main_sound_configuration_test5)
}
+BOOST_AUTO_TEST_CASE(main_sound_configuration_test6)
+{
+ dcp::MainSoundConfiguration msc("WTF/L,R,C,LFE,LsLss,RsRss,HI,VIN,Lc,Rc,Lrs,Rrs,Mtn,FSKSync,SLVS,-");
+ BOOST_CHECK_EQUAL(msc.channels(), 16);
+ BOOST_CHECK_EQUAL(msc.field(), dcp::MCASoundField::OTHER);
+ BOOST_CHECK_EQUAL(msc.mapping(0).get(), dcp::Channel::LEFT);
+ BOOST_CHECK_EQUAL(msc.mapping(1).get(), dcp::Channel::RIGHT);
+ BOOST_CHECK_EQUAL(msc.mapping(2).get(), dcp::Channel::CENTRE);
+ BOOST_CHECK_EQUAL(msc.mapping(3).get(), dcp::Channel::LFE);
+ BOOST_CHECK_EQUAL(msc.mapping(4).get(), dcp::Channel::LS);
+ BOOST_CHECK_EQUAL(msc.mapping(5).get(), dcp::Channel::RS);
+ BOOST_CHECK_EQUAL(msc.mapping(6).get(), dcp::Channel::HI);
+ BOOST_CHECK_EQUAL(msc.mapping(7).get(), dcp::Channel::VI);
+ BOOST_CHECK_EQUAL(msc.mapping(8).get(), dcp::Channel::LC);
+ BOOST_CHECK_EQUAL(msc.mapping(9).get(), dcp::Channel::RC);
+ BOOST_CHECK_EQUAL(msc.mapping(10).get(), dcp::Channel::BSL);
+ BOOST_CHECK_EQUAL(msc.mapping(11).get(), dcp::Channel::BSR);
+ BOOST_CHECK_EQUAL(msc.mapping(12).get(), dcp::Channel::MOTION_DATA);
+ BOOST_CHECK_EQUAL(msc.mapping(13).get(), dcp::Channel::SYNC_SIGNAL);
+ BOOST_CHECK_EQUAL(msc.mapping(14).get(), dcp::Channel::SIGN_LANGUAGE);
+ BOOST_CHECK(!msc.mapping(15));
+}
+
+
/* 482-12 says that implementations may use case-insensitive comparisons for the channel identifiers,
* and there is one DCP in the private test suite (made by Disney) that uses LS for left surround.
*/
diff --git a/test/stream_operators.cc b/test/stream_operators.cc
index 4895076a..348abd2f 100644
--- a/test/stream_operators.cc
+++ b/test/stream_operators.cc
@@ -130,6 +130,12 @@ dcp::operator<<(ostream& s, Channel c)
case Channel::VI:
s << "vi(7)";
break;
+ case Channel::LC:
+ s << "lc(8)";
+ break;
+ case Channel::RC:
+ s << "rc(9)";
+ break;
case Channel::BSL:
s << "bsl(10)";
break;