diff options
| author | John Hurst <jhurst@cinecert.com> | 2021-01-12 12:46:52 -0800 |
|---|---|---|
| committer | John Hurst <jhurst@cinecert.com> | 2021-01-12 12:46:52 -0800 |
| commit | f69df80edc00a138f50fd527706c78617342dcdd (patch) | |
| tree | 8797cf6a3afc7fca45296d753b2033d74558044f /src/AS_DCP_MPEG2.cpp | |
| parent | 70d6b24694d5d243d5e09cecd34097180a4f2d62 (diff) | |
| parent | 8400c964b7852fd5be2b23640bf665cf69d85593 (diff) | |
Merge branch 'master' into sha1_builtin
Diffstat (limited to 'src/AS_DCP_MPEG2.cpp')
| -rwxr-xr-x | src/AS_DCP_MPEG2.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/AS_DCP_MPEG2.cpp b/src/AS_DCP_MPEG2.cpp index 8afa8bc..b7e6252 100755 --- a/src/AS_DCP_MPEG2.cpp +++ b/src/AS_DCP_MPEG2.cpp @@ -48,9 +48,11 @@ MD_to_MPEG2_VDesc(MXF::MPEG2VideoDescriptor* VDescObj, MPEG2::VideoDescriptor& V VDesc.SampleRate = VDescObj->SampleRate; VDesc.EditRate = VDescObj->SampleRate; VDesc.FrameRate = VDescObj->SampleRate.Numerator; - assert(VDescObj->ContainerDuration <= 0xFFFFFFFFL); - VDesc.ContainerDuration = (ui32_t) VDescObj->ContainerDuration; - + if ( ! VDescObj->ContainerDuration.empty() ) + { + assert(VDescObj->ContainerDuration <= 0xFFFFFFFFL); + VDesc.ContainerDuration = (ui32_t) VDescObj->ContainerDuration; + } VDesc.FrameLayout = VDescObj->FrameLayout; VDesc.StoredWidth = VDescObj->StoredWidth; VDesc.StoredHeight = VDescObj->StoredHeight; @@ -58,13 +60,29 @@ MD_to_MPEG2_VDesc(MXF::MPEG2VideoDescriptor* VDescObj, MPEG2::VideoDescriptor& V VDesc.ComponentDepth = VDescObj->ComponentDepth; VDesc.HorizontalSubsampling = VDescObj->HorizontalSubsampling; - VDesc.VerticalSubsampling = VDescObj->VerticalSubsampling; - VDesc.ColorSiting = VDescObj->ColorSiting; - VDesc.CodedContentType = VDescObj->CodedContentType; + if ( ! VDescObj->VerticalSubsampling.empty() ) + { + VDesc.VerticalSubsampling = VDescObj->VerticalSubsampling; + } + if ( ! VDescObj->ColorSiting.empty() ) + { + VDesc.ColorSiting = VDescObj->ColorSiting; + } + if ( ! VDescObj->CodedContentType.empty() ) + { + VDesc.CodedContentType = VDescObj->CodedContentType; + } VDesc.LowDelay = VDescObj->LowDelay.get() == 0 ? false : true; - VDesc.BitRate = VDescObj->BitRate; - VDesc.ProfileAndLevel = VDescObj->ProfileAndLevel; + if ( ! VDescObj->BitRate.empty() ) + { + VDesc.BitRate = VDescObj->BitRate; + } + if ( ! VDescObj->ProfileAndLevel.empty() ) + { + VDesc.ProfileAndLevel = VDescObj->ProfileAndLevel; + } + return RESULT_OK; } @@ -77,7 +95,6 @@ MPEG2_VDesc_to_MD(MPEG2::VideoDescriptor& VDesc, MXF::MPEG2VideoDescriptor* VDes VDescObj->SampleRate = VDesc.SampleRate; VDescObj->ContainerDuration = VDesc.ContainerDuration; - VDescObj->FrameLayout = VDesc.FrameLayout; VDescObj->StoredWidth = VDesc.StoredWidth; VDescObj->StoredHeight = VDesc.StoredHeight; |
