X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2FAS_DCP_JP2K.cpp;h=58bc0c93f49d342dfb0a8d7c46bff1be8edd5eba;hb=9e32c7029082710ed909ce78d33d6a9b41996dda;hp=86327c283fc52cae465c84c7c4fba06fb5532662;hpb=b8f6cd62d308e3cdb88e55f675b4883257767b79;p=asdcplib.git diff --git a/src/AS_DCP_JP2K.cpp b/src/AS_DCP_JP2K.cpp index 86327c2..58bc0c9 100755 --- a/src/AS_DCP_JP2K.cpp +++ b/src/AS_DCP_JP2K.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2009, John Hurst +Copyright (c) 2004-2010, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -263,18 +263,18 @@ lh__Reader::MD_to_JP2K_PDesc(JP2K::PictureDescriptor& PDesc) DefaultLogSink().Error("Unexpected PictureComponentSizing size: %u, should be 17\n", tmp_size); // CodingStyleDefault - memset(&m_PDesc.CodingStyleDefault, 0, sizeof(CodingStyleDefault_t)); - memcpy(&m_PDesc.CodingStyleDefault, + memset(&PDesc.CodingStyleDefault, 0, sizeof(CodingStyleDefault_t)); + memcpy(&PDesc.CodingStyleDefault, m_EssenceSubDescriptor->CodingStyleDefault.RoData(), m_EssenceSubDescriptor->CodingStyleDefault.Length()); // QuantizationDefault - memset(&m_PDesc.QuantizationDefault, 0, sizeof(QuantizationDefault_t)); - memcpy(&m_PDesc.QuantizationDefault, + memset(&PDesc.QuantizationDefault, 0, sizeof(QuantizationDefault_t)); + memcpy(&PDesc.QuantizationDefault, m_EssenceSubDescriptor->QuantizationDefault.RoData(), m_EssenceSubDescriptor->QuantizationDefault.Length()); - m_PDesc.QuantizationDefault.SPqcdLength = m_EssenceSubDescriptor->QuantizationDefault.Length() - 1; + PDesc.QuantizationDefault.SPqcdLength = m_EssenceSubDescriptor->QuantizationDefault.Length() - 1; } return RESULT_OK; @@ -834,11 +834,6 @@ lh__Writer::SetSourceStream(const PictureDescriptor& PDesc, const std::string& l m_PDesc = PDesc; Result_t result = JP2K_PDesc_to_MD(m_PDesc); - if ( ASDCP_SUCCESS(result) ) - result = WriteMXFHeader(label, UL(m_Dict->ul(MDD_JPEG_2000Wrapping)), - PICT_DEF_LABEL, UL(m_Dict->ul(MDD_PictureDataDef)), - LocalEditRate, 24 /* TCFrameRate */); - if ( ASDCP_SUCCESS(result) ) { memcpy(m_EssenceUL, m_Dict->ul(MDD_JPEG2000Essence), SMPTE_UL_LENGTH); @@ -846,6 +841,11 @@ lh__Writer::SetSourceStream(const PictureDescriptor& PDesc, const std::string& l result = m_State.Goto_READY(); } + if ( ASDCP_SUCCESS(result) ) + result = WriteMXFHeader(label, UL(m_Dict->ul(MDD_JPEG_2000Wrapping)), + PICT_DEF_LABEL, UL(m_EssenceUL), UL(m_Dict->ul(MDD_PictureDataDef)), + LocalEditRate, 24 /* TCFrameRate */); + return result; }