summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormsheby <msheby@cinecert.com>2009-08-25 20:37:34 +0000
committermsheby <>2009-08-25 20:37:34 +0000
commitdb7fa5c0ca1143b100edd42e06dec560a9c0e26e (patch)
tree22224f3272acb5ac2cbfff6df91bcc729f96d084 /src
parent34164501e089d942417c741a0c305c2c620f8866 (diff)
Add GetSecondsSinceEpoch for Waimea.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/KM_util.cpp12
-rwxr-xr-xsrc/KM_util.h3
-rwxr-xr-xsrc/PCMParserList.cpp26
-rwxr-xr-xsrc/wavesplit.cpp2
4 files changed, 39 insertions, 4 deletions
diff --git a/src/KM_util.cpp b/src/KM_util.cpp
index ba27a37..08ae257 100755
--- a/src/KM_util.cpp
+++ b/src/KM_util.cpp
@@ -1125,6 +1125,18 @@ Kumu::Timestamp::Archive(MemIOWriter* Writer) const
return true;
}
+//
+long
+Kumu::Timestamp::GetSecondsSinceEpoch(void) const
+{
+ Kumu::TAI::caltime ct;
+ Kumu::TAI::tai t;
+ TIMESTAMP_TO_CALTIME(*this, &ct);
+ t = ct;
+
+ return (long) (t.x - ui64_C(4611686018427387914));
+}
+
//------------------------------------------------------------------------------------------
Kumu::MemIOWriter::MemIOWriter(ByteString* Buf)
diff --git a/src/KM_util.h b/src/KM_util.h
index a9c96c6..28bea68 100755
--- a/src/KM_util.h
+++ b/src/KM_util.h
@@ -413,6 +413,9 @@ namespace Kumu
virtual ui32_t ArchiveLength() const { return 8L; }
virtual bool Archive(MemIOWriter* Writer) const;
virtual bool Unarchive(MemIOReader* Reader);
+
+ // Get the number of seconds since the Unix epoch (1970-01-01T00:00:00+00:00)
+ long GetSecondsSinceEpoch(void) const;
};
//
diff --git a/src/PCMParserList.cpp b/src/PCMParserList.cpp
index 919a76e..09bd44c 100755
--- a/src/PCMParserList.cpp
+++ b/src/PCMParserList.cpp
@@ -30,9 +30,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <PCMParserList.h>
+#include <KM_log.h>
#include <assert.h>
using namespace ASDCP;
+using namespace Kumu;
ASDCP::ParserInstance::ParserInstance() : m_p(0), m_SampleSize(0)
@@ -121,10 +123,28 @@ ASDCP::PCMParserList::OpenRead(ui32_t argc, const char** argv, Rational& Picture
if ( ASDCP_SUCCESS(result) )
{
if ( i == 0 )
- m_ADesc = I->ADesc;
-
+ {
+ m_ADesc = I->ADesc;
+ }
else
- m_ADesc.BlockAlign += I->ADesc.BlockAlign;
+ {
+ if ( I->ADesc.AudioSamplingRate != m_ADesc.AudioSamplingRate )
+ {
+ DefaultLogSink().Error("AudioSamplingRate mismatch in PCM parser list.");
+ return RESULT_FORMAT;
+ }
+
+ if ( I->ADesc.QuantizationBits != m_ADesc.QuantizationBits )
+ {
+ DefaultLogSink().Error("QuantizationBits mismatch in PCM parser list.");
+ return RESULT_FORMAT;
+ }
+
+ if ( I->ADesc.ContainerDuration < m_ADesc.ContainerDuration )
+ m_ADesc.ContainerDuration = I->ADesc.ContainerDuration;
+
+ m_ADesc.BlockAlign += I->ADesc.BlockAlign;
+ }
m_ChannelCount += I->ADesc.ChannelCount;
}
diff --git a/src/wavesplit.cpp b/src/wavesplit.cpp
index c189733..90e7e93 100755
--- a/src/wavesplit.cpp
+++ b/src/wavesplit.cpp
@@ -50,7 +50,7 @@ static const char* PROGRAM_NAME = "wavesplit"; // program name for messages
// otherwise sets the given flag.
#define TEST_SET_MAJOR_MODE(f) if ( TEST_MAJOR_MODE() ) \
{ \
- fputs("Conflicting major mode, choose one of -(ic)).\n", stderr); \
+ fputs("Conflicting major mode, choose one of -(ic).\n", stderr); \
return; \
} \
(f) = true;