From 175ded3a38c97ccad411f687d94d7017f20ebec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= Date: Wed, 22 Jun 2022 15:12:40 +0200 Subject: [PATCH] + DV analysis: provide capture speed --- Source/MediaInfo/Multiple/File_DvDif.cpp | 2 +- Source/MediaInfo/Multiple/File_DvDif.h | 1 + Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/MediaInfo/Multiple/File_DvDif.cpp b/Source/MediaInfo/Multiple/File_DvDif.cpp index 9cef99dec..92b151e99 100644 --- a/Source/MediaInfo/Multiple/File_DvDif.cpp +++ b/Source/MediaInfo/Multiple/File_DvDif.cpp @@ -575,7 +575,7 @@ void File_DvDif::Streams_Finish() } #ifdef MEDIAINFO_DVDIF_ANALYZE_YES - if (Config->File_DvDif_Analysis_Get()) + if (Config->File_DvDif_Analysis_Get() && !Config->File_FrameIsAlwaysComplete_Get()) { //Errors stats Status[IsFinished]=true; //We need to fill it before the call to Errors_Stats_Update diff --git a/Source/MediaInfo/Multiple/File_DvDif.h b/Source/MediaInfo/Multiple/File_DvDif.h index dba351946..2673c92a9 100644 --- a/Source/MediaInfo/Multiple/File_DvDif.h +++ b/Source/MediaInfo/Multiple/File_DvDif.h @@ -224,6 +224,7 @@ protected : bool REC_ST; bool REC_END; bool REC_IsValid; + std::vector DirectionSpeed; struct dvdate { int8u Days; diff --git a/Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp b/Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp index 7ee410a0f..3f12ac8fb 100644 --- a/Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp +++ b/Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp @@ -519,6 +519,8 @@ void File_DvDif::Read_Buffer_Continue() REC_END=(Buffer[Buffer_Offset+3+2]&0x40)?true:false; REC_IsValid=true; Coherency_Flags.set(Coherency_audio_control); + + DirectionSpeed.push_back(Buffer[Buffer_Offset+3+3]); } //audio_recdate @@ -1853,6 +1855,17 @@ void File_DvDif::Errors_Stats_Update() Event1.Audio_Data_Errors_Count=16; Event1.Audio_Data_Errors=Audio_Errors_PerDseq; } + if (true) + { + if (!MoreData) + MoreData=new int8u[4096]+sizeof(size_t); // TODO: more dynamic allocation + MoreData[MoreData_Offset++]=2+DirectionSpeed.size(); + MoreData[MoreData_Offset++]=2; // DirectionSpeed values + for (std::vector::iterator DirectionSpeed_Item=DirectionSpeed.begin(); DirectionSpeed_Item!=DirectionSpeed.end(); ++DirectionSpeed_Item) + { + MoreData[MoreData_Offset++]=*DirectionSpeed_Item; + } + } Event1.Captions_Errors=Captions_Flags[1]?1:0; Captions_Flags.reset(1); Event1.Coherency_Flags=(Coherency_Flags[Coherency_PackInSub]?0:(1<<0)) @@ -1971,6 +1984,7 @@ void File_DvDif::Errors_Stats_Update() Speed_FrameCount++; Speed_FrameCount_system[system]++; REC_IsValid=false; + DirectionSpeed.clear(); audio_source_mode.clear(); Speed_Contains_NULL=0; Video_STA_Errors.clear();