megasubs
authorjhurst <jhurst@cinecert.com>
Sun, 22 Feb 2015 20:16:28 +0000 (20:16 +0000)
committerjhurst <>
Sun, 22 Feb 2015 20:16:28 +0000 (20:16 +0000)
src/AS_02_TimedText.cpp
src/AS_DCP_TimedText.cpp
src/MXF.cpp
src/MXFTypes.cpp
src/Wav.cpp
src/path-test.cpp

index fc851ecd13fe2974af088b029eee6fef2de58f1d..7faa7ce84365f6dce453fee816a12cead303eb5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2008-2014, John Hurst
+Copyright (c) 2008-2015, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -514,6 +514,9 @@ AS_02::TimedText::MXFWriter::h__Writer::SetSourceStream(ASDCP::TimedText::TimedT
          resourceSubdescriptor->EssenceStreamID = m_EssenceStreamID++;
          m_EssenceSubDescriptorList.push_back((FileDescriptor*)resourceSubdescriptor);
          m_EssenceDescriptor->SubDescriptors.push_back(resourceSubdescriptor->InstanceUID);
+
+         // 72 == sizeof K, L, instanceuid, uuid + sizeof int32 + tag/len * 4
+         m_HeaderSize += ( resourceSubdescriptor->MIMEMediaType.ArchiveLength() * 2 /*ArchiveLength is broken*/ ) + 72;
        }
     }
   
index 6b5282344c3d25695420412ce6a3a6d4d0ffa322..52740377048918ab1771da2778b703972eb59ac8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2008-2014, John Hurst
+Copyright (c) 2008-2015, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -569,7 +569,9 @@ ASDCP::TimedText::MXFWriter::h__Writer::SetSourceStream(ASDCP::TimedText::TimedT
       resourceSubdescriptor->EssenceStreamID = m_EssenceStreamID++;
       m_EssenceSubDescriptorList.push_back((FileDescriptor*)resourceSubdescriptor);
       m_EssenceDescriptor->SubDescriptors.push_back(resourceSubdescriptor->InstanceUID);
-      m_HeaderSize += resourceSubdescriptor->MIMEMediaType.ArchiveLength() + 20; // 20 == sizeof uuid + sizeof int32
+
+      // 72 == sizeof K, L, instanceuid, uuid + sizeof int32 + tag/len * 4
+      m_HeaderSize += ( resourceSubdescriptor->MIMEMediaType.ArchiveLength() * 2 /*ArchiveLength is broken*/ ) + 72;
     }
 
   m_EssenceStreamID = 10;
index c3a3a5d6d28139063522533ea946ebf63f15c69a..d0ece08c42b7f45791543da4b06b17e0e9908fdf 100755 (executable)
@@ -881,7 +881,7 @@ ASDCP::MXF::OP1aHeader::WriteToFile(Kumu::FileWriter& Writer, ui32_t HeaderSize)
   if ( HeaderSize < 4096 ) 
     {
       DefaultLogSink().Error("HeaderSize %u is too small. Must be >= 4096\n", HeaderSize);
-      return RESULT_FAIL;
+      return RESULT_PARAM;
     }
 
   ASDCP::FrameBuffer HeaderBuffer;
index 46ddf612b7c5a261772c2dca28ad0c0885702718..6f0358fded243c94d8b0f75f324ca8a03612ff18 100755 (executable)
@@ -326,7 +326,9 @@ ASDCP::MXF::UTF16String::Archive(Kumu::MemIOWriter* Writer) const
          return false;
        }
       else if ( count  == 0 )
-       break;
+       {
+         break;
+       }
 
       bool result = Writer->WriteUi16BE((ui16_t)wcp);
 
index 0ba3fe81a152e932fe4f287727d0c7b1c5a627e5..20776d56190446e5d3004f3d14f863ede950df41 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005-2009, John Hurst
+Copyright (c) 2005-2015, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -408,7 +408,7 @@ ASDCP::RF64::SimpleRF64Header::WriteToFile(Kumu::FileWriter& OutFile) const
 
   ui32_t write_count = 0;
   ui64_t RIFF_len = data_len + SimpleWavHeaderLength - 8;
-  DefaultLogSink().Debug("RIFF_len is %llu.\n", RIFF_len);
+  //  DefaultLogSink().Debug("RIFF_len is %llu.\n", RIFF_len);
   byte_t* tmp_header = NULL;
   ui32_t header_len = 0;
 
index 30a5e09f81864d0f9fd1a2f8cc0d507ec085315f..f3cb131b7aa6c4ef72e895099cb2afa8cddd2d14 100644 (file)
@@ -141,6 +141,7 @@ main(int argc, const char** argv)
   FreeSpaceForPath("/", free_space, total_space);
   cerr << "Free space: " << free_space << endl;
   cerr << "Total space: " << total_space << endl;
+  cerr << "Used space: " << ( (total_space - free_space ) / float(total_space) ) << endl;
 
   cerr << "OK" << endl;