From 4feb0d048d4713cdb77c9b51231a9c15780207cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= Date: Fri, 14 Oct 2022 12:58:31 +0200 Subject: [PATCH 1/2] coherency_flags refactoring --- Source/Common/Merge.cpp | 2 +- Source/Common/Output.h | 4 +++- Source/Common/Output_Xml.cpp | 4 ++-- Source/Common/ProcessFile.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Common/Merge.cpp b/Source/Common/Merge.cpp index 69e638e3..d7814d41 100644 --- a/Source/Common/Merge.cpp +++ b/Source/Common/Merge.cpp @@ -487,7 +487,7 @@ bool dv_merge_private::AppendFrameToList(size_t InputPos, const MediaInfo_Event_ CurrentFrame.TC_SMPTE = timecode(FrameData); CurrentFrame.AbstBf = abst_bf(FrameData->AbstBf); CurrentFrame.Speed = GetDvSpeed(*FrameData); - CurrentFrame.FullConcealed = coherency_flags(FrameData->Coherency_Flags).full_conceal(); + CurrentFrame.FullConcealed = coherency_flags(FrameData).full_conceal(); // Time code jumps - after first frame timecode TC_Temp(FrameData); diff --git a/Source/Common/Output.h b/Source/Common/Output.h index cc7a9c6f..a26a3149 100644 --- a/Source/Common/Output.h +++ b/Source/Common/Output.h @@ -111,7 +111,8 @@ struct rec_date_time struct coherency_flags { public: - coherency_flags(decltype(MediaInfo_Event_DvDif_Analysis_Frame_1::Coherency_Flags) Value) : _Value(Value) {} + coherency_flags(const MediaInfo_Event_DvDif_Analysis_Frame_1& Frame) : _Value(Frame.Coherency_Flags), _Value2(Frame.MoreFlags) {} + coherency_flags(const MediaInfo_Event_DvDif_Analysis_Frame_1* Frame) : _Value(Frame->Coherency_Flags), _Value2(Frame->MoreFlags) {} inline bool no_pack_sub() { return ((_Value >> 0) & 0x1); } // 0 inline bool no_pack_vid() { return ((_Value >> 1) & 0x1); } // 1 inline bool no_pack_aud() { return ((_Value >> 2) & 0x1); } // 2 @@ -124,6 +125,7 @@ struct coherency_flags private: decltype(MediaInfo_Event_DvDif_Analysis_Frame_1::Coherency_Flags) _Value; + decltype(MediaInfo_Event_DvDif_Analysis_Frame_1::MoreFlags) _Value2; }; //*************************************************************************** diff --git a/Source/Common/Output_Xml.cpp b/Source/Common/Output_Xml.cpp index 185adf9f..8656baa2 100644 --- a/Source/Common/Output_Xml.cpp +++ b/Source/Common/Output_Xml.cpp @@ -226,7 +226,7 @@ return_value Output_Xml(ostream& Out, std::vector& PerFile, bitset