@@ -48,23 +48,41 @@ MD_to_MPEG2_VDesc(MXF::MPEG2VideoDescriptor* VDescObj, MPEG2::VideoDescriptor& V
4848 VDesc.SampleRate = VDescObj->SampleRate ;
4949 VDesc.EditRate = VDescObj->SampleRate ;
5050 VDesc.FrameRate = VDescObj->SampleRate .Numerator ;
51- assert (VDescObj->ContainerDuration <= 0xFFFFFFFFL );
52- VDesc.ContainerDuration = (ui32_t ) VDescObj->ContainerDuration ;
53-
51+ if ( ! VDescObj->ContainerDuration .empty () )
52+ {
53+ assert (VDescObj->ContainerDuration <= 0xFFFFFFFFL );
54+ VDesc.ContainerDuration = (ui32_t ) VDescObj->ContainerDuration ;
55+ }
5456 VDesc.FrameLayout = VDescObj->FrameLayout ;
5557 VDesc.StoredWidth = VDescObj->StoredWidth ;
5658 VDesc.StoredHeight = VDescObj->StoredHeight ;
5759 VDesc.AspectRatio = VDescObj->AspectRatio ;
5860
5961 VDesc.ComponentDepth = VDescObj->ComponentDepth ;
6062 VDesc.HorizontalSubsampling = VDescObj->HorizontalSubsampling ;
61- VDesc.VerticalSubsampling = VDescObj->VerticalSubsampling ;
62- VDesc.ColorSiting = VDescObj->ColorSiting ;
63- VDesc.CodedContentType = VDescObj->CodedContentType ;
63+ if ( ! VDescObj->VerticalSubsampling .empty () )
64+ {
65+ VDesc.VerticalSubsampling = VDescObj->VerticalSubsampling ;
66+ }
67+ if ( ! VDescObj->ColorSiting .empty () )
68+ {
69+ VDesc.ColorSiting = VDescObj->ColorSiting ;
70+ }
71+ if ( ! VDescObj->CodedContentType .empty () )
72+ {
73+ VDesc.CodedContentType = VDescObj->CodedContentType ;
74+ }
6475
6576 VDesc.LowDelay = VDescObj->LowDelay .get () == 0 ? false : true ;
66- VDesc.BitRate = VDescObj->BitRate ;
67- VDesc.ProfileAndLevel = VDescObj->ProfileAndLevel ;
77+ if ( ! VDescObj->BitRate .empty () )
78+ {
79+ VDesc.BitRate = VDescObj->BitRate ;
80+ }
81+ if ( ! VDescObj->ProfileAndLevel .empty () )
82+ {
83+ VDesc.ProfileAndLevel = VDescObj->ProfileAndLevel ;
84+ }
85+
6886 return RESULT_OK;
6987}
7088
@@ -77,7 +95,6 @@ MPEG2_VDesc_to_MD(MPEG2::VideoDescriptor& VDesc, MXF::MPEG2VideoDescriptor* VDes
7795
7896 VDescObj->SampleRate = VDesc.SampleRate ;
7997 VDescObj->ContainerDuration = VDesc.ContainerDuration ;
80-
8198 VDescObj->FrameLayout = VDesc.FrameLayout ;
8299 VDescObj->StoredWidth = VDesc.StoredWidth ;
83100 VDescObj->StoredHeight = VDesc.StoredHeight ;
0 commit comments