Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mp4 edts trace info #1442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions Source/MediaInfo/File__Analyze.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,12 @@ public :
void Get_B2 (int16u &Info, const char* Name);
void Get_B3 (int32u &Info, const char* Name);
void Get_B4 (int32u &Info, const char* Name);
void Get_B4S (int32s &Info, const char* Name);
void Get_B5 (int64u &Info, const char* Name);
void Get_B6 (int64u &Info, const char* Name);
void Get_B7 (int64u &Info, const char* Name);
void Get_B8 (int64u &Info, const char* Name);
void Get_B8S (int64s &Info, const char* Name);
void Get_B16 (int128u &Info, const char* Name);
void Get_BF2 (float32 &Info, const char* Name);
void Get_BF4 (float32 &Info, const char* Name);
Expand Down
19 changes: 19 additions & 0 deletions Source/MediaInfo/File__Analyze_Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ void File__Analyze::Get_B4(int32u &Info, const char* Name)
Element_Offset+=4;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B4S(int32s &Info, const char* Name)
{
INTEGRITY_SIZE_ATLEAST_INT(4);
Info=BigEndian2int32s(Buffer+Buffer_Offset+(size_t)Element_Offset);
if (Trace_Activated)
Param(Name, Info);
Element_Offset+=4;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B5(int64u &Info, const char* Name)
{
Expand Down Expand Up @@ -223,6 +233,15 @@ void File__Analyze::Get_B8(int64u &Info, const char* Name)
Element_Offset+=8;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B8S(int64s &Info, const char* Name)
{
INTEGRITY_SIZE_ATLEAST_INT(8);
Info=BigEndian2int64s(Buffer+Buffer_Offset+(size_t)Element_Offset);
if (Trace_Activated) Param(Name, Info);
Element_Offset+=8;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B16(int128u &Info, const char* Name)
{
Expand Down
16 changes: 16 additions & 0 deletions Source/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ void File__Analyze::Get_B4_(int32u &Info)
Element_Offset+=4;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B4S_(int32s &Info)
{
INTEGRITY_SIZE_ATLEAST_INT(4);
Info=BigEndian2int32s(Buffer+Buffer_Offset+(size_t)Element_Offset);
Element_Offset+=4;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B5_(int64u &Info)
{
Expand Down Expand Up @@ -205,6 +213,14 @@ void File__Analyze::Get_B8_(int64u &Info)
Element_Offset+=8;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B8S_(int64s &Info)
{
INTEGRITY_SIZE_ATLEAST_INT(8);
Info=BigEndian2int64s(Buffer+Buffer_Offset+(size_t)Element_Offset);
Element_Offset+=8;
}

//---------------------------------------------------------------------------
void File__Analyze::Get_B16_(int128u &Info)
{
Expand Down
4 changes: 4 additions & 0 deletions Source/MediaInfo/File__Analyze_MinimizeSize.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@ public :
void Get_B2_ (int16u &Info);
void Get_B3_ (int32u &Info);
void Get_B4_ (int32u &Info);
void Get_B4S_ (int32s &Info);
void Get_B5_ (int64u &Info);
void Get_B6_ (int64u &Info);
void Get_B7_ (int64u &Info);
void Get_B8_ (int64u &Info);
void Get_B8S_ (int64s &Info);
void Get_B16_ (int128u &Info);
void Get_BF2_ (float32 &Info);
void Get_BF4_ (float32 &Info);
Expand All @@ -386,10 +388,12 @@ public :
#define Get_B2(Info, Name) Get_B2_(Info)
#define Get_B3(Info, Name) Get_B3_(Info)
#define Get_B4(Info, Name) Get_B4_(Info)
#define Get_B4S(Info, Name) Get_B4S_(Info)
#define Get_B5(Info, Name) Get_B5_(Info)
#define Get_B6(Info, Name) Get_B6_(Info)
#define Get_B7(Info, Name) Get_B7_(Info)
#define Get_B8(Info, Name) Get_B8_(Info)
#define Get_B8S(Info, Name) Get_B8S_(Info)
#define Get_B16(Info, Name) Get_B16_(Info)
#define Get_BF2(Info, Name) Get_BF2_(Info)
#define Get_BF4(Info, Name) Get_BF4_(Info)
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Multiple/File_Mpeg4.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ private :
struct edts_struct
{
int64u Duration;
int64u Delay;
int64s Delay;
int32u Rate;
};
std::vector<edts_struct> edts;
Expand Down
15 changes: 14 additions & 1 deletion Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,19 @@ void File_Mpeg4::Data_Parse()
Get_B8(_INFO, _NAME); \
} \

// Bigendian signed
#define Get_BS_DEPENDOFVERSION(_INFO, _NAME) \
{ \
if (Version==0) \
{ \
int32s Info; \
Get_B4S(Info, _NAME); \
_INFO=Info; \
} \
else \
Get_B8S(_INFO, _NAME); \
} \

#define Get_DATE1904_DEPENDOFVERSION(_INFO, _NAME) \
{ \
if (Version==0) \
Expand Down Expand Up @@ -3856,7 +3869,7 @@ void File_Mpeg4::moov_trak_edts_elst()
stream::edts_struct edts;
Element_Begin1("Entry");
Get_B_DEPENDOFVERSION(edts.Duration, "Track duration"); Param_Info2C(moov_mvhd_TimeScale, (int64u)edts.Duration*1000/moov_mvhd_TimeScale, " ms");
Get_B_DEPENDOFVERSION(edts.Delay, "Media time"); Param_Info2C(moov_mvhd_TimeScale && (edts.Delay!=(int32u)-1), (int64u)edts.Delay*1000/moov_mvhd_TimeScale, " ms");
Get_BS_DEPENDOFVERSION(edts.Delay, "Media time"); Param_Info2C(edts.Delay > 0, edts.Delay, " / media header time scale");
Get_B4 (edts.Rate, "Media rate"); Param_Info1(((float)edts.Rate)/0x10000);
Element_End0();

Expand Down