Skip to content

Commit

Permalink
Merge pull request #1556 from JeromeMartinez/DVRescue_speed
Browse files Browse the repository at this point in the history
DV analysis: provide capture speed
  • Loading branch information
JeromeMartinez authored Jun 23, 2022
2 parents e4cfee9 + 175ded3 commit b7a672f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MediaInfo/Multiple/File_DvDif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Multiple/File_DvDif.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ protected :
bool REC_ST;
bool REC_END;
bool REC_IsValid;
std::vector<int8u> DirectionSpeed;
struct dvdate
{
int8u Days;
Expand Down
14 changes: 14 additions & 0 deletions Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<int8u>::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))
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b7a672f

Please sign in to comment.