Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Source/CLI/CommandLine_Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ return_value Parse(Core &C, int argc, const char* argv_ansi[], const MediaInfoNa
{
OutputFrames_Concealed = false;
}
else if (!strcmp(argv_ansi[i], "--merge-output-nodata"))
{
OutputFrames_NoData = true;
}
else if (!strcmp(argv_ansi[i], "--merge-ignore-nodata"))
{
OutputFrames_NoData = false;
}
else if (!strcmp(argv_ansi[i], "--merge-log-missing"))
{
ShowFrames_Missing = true;
Expand Down
6 changes: 5 additions & 1 deletion Source/Common/Merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ uint64_t Timeout = 0;
uint8_t UseAbst = 0;
bool OutputFrames_Speed = false;
bool OutputFrames_Concealed = false;
bool OutputFrames_NoData = false;
int ShowFrames_Missing = -1;
int ShowFrames_Intermediate = -1;
extern void timecode_to_string(string& Data, int Seconds, bool DropFrame, int Frames);
Expand Down Expand Up @@ -113,6 +114,7 @@ namespace
uint8_t RepeatCount = 0;
int Speed = INT_MIN;
int FullConcealed = false;
bool NoData = false;

per_frame() = default;
per_frame(status const& Status_, ::TimeCode const& TC_, uint8_t* const& BlockStatus_, size_t BlockStatus_Count_) :
Expand Down Expand Up @@ -487,7 +489,8 @@ 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();
CurrentFrame.NoData = coherency_flags(FrameData).no_data();

// Time code jumps - after first frame
timecode TC_Temp(FrameData);
Expand Down Expand Up @@ -1489,6 +1492,7 @@ bool dv_merge_private::Process(float Speed)
if (true
&& (OutputFrames_Speed || (Speed && Speed != 1.0) || GetDvSpeedIsNormalPlayback(DvSpeed))
&& (OutputFrames_Concealed || (Prefered_Frame != -1 && !Inputs[Prefered_Frame]->Segments[Segment_Pos].Frames[Frame_Pos].FullConcealed))
&& (OutputFrames_NoData || (Prefered_Frame != -1 && !Inputs[Prefered_Frame]->Segments[Segment_Pos].Frames[Frame_Pos].NoData))
&& (ShowFrames_Intermediate || (Prefered_Frame != -1 && FirstBadFrame == -1))
)
{
Expand Down
1 change: 1 addition & 0 deletions Source/Common/Merge.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern uint64_t Timeout;
extern uint8_t UseAbst;
extern bool OutputFrames_Speed;
extern bool OutputFrames_Concealed;
extern bool OutputFrames_NoData;
extern int ShowFrames_Missing;
extern int ShowFrames_Intermediate;
extern bool InControl;
Expand Down
5 changes: 4 additions & 1 deletion Source/Common/Output.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -121,9 +122,11 @@ struct coherency_flags
inline bool no_sourceorcontrol_aud() { return ((_Value >> 6) & 0x1); } // 6
inline bool no_pack() { return no_pack_sub() && no_pack_vid() && no_pack_aud() ; }
inline bool full_conceal() { return full_conceal_vid() && full_conceal_aud(); }
inline bool no_data() { return (_Value2 >> 3) & 0x1; } //

private:
decltype(MediaInfo_Event_DvDif_Analysis_Frame_1::Coherency_Flags) _Value;
decltype(MediaInfo_Event_DvDif_Analysis_Frame_1::MoreFlags) _Value2;
};

//***************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions Source/Common/Output_Xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ return_value Output_Xml(ostream& Out, std::vector<file*>& PerFile, bitset<Option
const auto& Frame2_Max = PerChange_Next != File->PerChange.end() ? (File->PerFrame.begin() + (*PerChange_Next)->FrameNumber) : File->PerFrame.end();
for (auto Frame2 = File->PerFrame.begin() + FrameNumber; Frame2 < Frame2_Max; ++Frame2)
{
coherency_flags Coherency((*Frame2)->Coherency_Flags);
coherency_flags Coherency(*Frame2);
if (Coherency.no_pack_aud() || !Coherency.no_sourceorcontrol_aud())
{
no_sourceorcontrol_aud_Everywhere = false;
Expand Down Expand Up @@ -512,7 +512,7 @@ return_value Output_Xml(ostream& Out, std::vector<file*>& PerFile, bitset<Option
}

// Coherency
coherency_flags Coherency(Frame->Coherency_Flags);
coherency_flags Coherency(Frame);
if (Coherency.no_pack())
{
Text += " no_pack=\"1\"";
Expand Down
2 changes: 1 addition & 1 deletion Source/Common/ProcessFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ void file::AddFrameAnalysis(const MediaInfo_Event_DvDif_Analysis_Frame_1* FrameD
}
PerFrame.push_back(ToPush);

coherency_flags Coherency(FrameData->Coherency_Flags);
coherency_flags Coherency(FrameData);
if (!no_sourceorcontrol_aud_set_in_first_frame && !(Coherency.no_pack_aud() || !Coherency.no_sourceorcontrol_aud()))
{
if (!PerChange.empty() && ToPush->FrameNumber == PerChange.back()->FrameNumber)
Expand Down