Skip to content

Commit

Permalink
Merge pull request #66 from g-maxime/tapt-fix
Browse files Browse the repository at this point in the history
Find for video fields duplicates only in the same track
  • Loading branch information
JeromeMartinez authored Mar 5, 2024
2 parents 6a3393e + 118a3e8 commit 9ce2063
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 264 deletions.
40 changes: 21 additions & 19 deletions Source/Common/mp4/mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clap::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx clap blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_clap();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_clap();

Read_Internal_ReadAllInBuffer();

Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Width_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Width_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Height_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Height_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Horizontal_Offset_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Horizontal_Offset_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Vertical_Offset_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Vertical_Offset_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Width_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Width_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Height_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Height_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Horizontal_Offset_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Horizontal_Offset_Den);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Vertical_Offset_Num);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Vertical_Offset_Den);
}

//***************************************************************************
Expand All @@ -44,7 +46,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clap::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -56,14 +58,14 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clap::Modify_Internal()
Chunk.Content.Size = 32;
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Width_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Width_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Height_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Aperture_Height_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Horizontal_Offset_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Horizontal_Offset_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Vertical_Offset_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap->Vertical_Offset_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Width_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Width_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Height_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Aperture_Height_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Horizontal_Offset_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Horizontal_Offset_Den);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Vertical_Offset_Num);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clap[Chunk.trak_Index]->Vertical_Offset_Den);

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clli::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx clli blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli = new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_clli();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli[Chunk.trak_Index] = new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_clli();

Read_Internal_ReadAllInBuffer();

int16u Temp;
Get_B2(Temp);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli->maximum_content_light_level=(double)Temp;
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli[Chunk.trak_Index]->maximum_content_light_level=(double)Temp;
Get_B2(Temp);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli->maximum_frame_average_light_level=(double)Temp;
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli[Chunk.trak_Index]->maximum_frame_average_light_level=(double)Temp;
}

//***************************************************************************
Expand All @@ -42,7 +44,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clli::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -54,8 +56,8 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_clli::Modify_Internal()
Chunk.Content.Size = 4;
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli->maximum_content_light_level));
Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli->maximum_frame_average_light_level));
Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli[Chunk.trak_Index]->maximum_content_light_level));
Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_clli[Chunk.trak_Index]->maximum_frame_average_light_level));

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
20 changes: 11 additions & 9 deletions Source/Common/mp4/mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_colr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_colr::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx colr blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_colr();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_colr();

Read_Internal_ReadAllInBuffer();

Expand All @@ -30,9 +32,9 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_colr::Read_Internal()
if (Type!=0x6E636C63) //nclc
throw exception_read_block("unsupported colr type");

Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Primaries);
Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Transfer);
Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Matrix);
Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Primaries);
Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Transfer);
Get_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Matrix);
}

//***************************************************************************
Expand All @@ -45,7 +47,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_colr::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -58,9 +60,9 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_colr::Modify_Internal()
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B4(0x6E636C63); // nclc
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Primaries);
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Transfer);
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr->Matrix);
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Primaries);
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Transfer);
Put_B2(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_colr[Chunk.trak_Index]->Matrix);

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_fiel::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx fiel blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_fiel();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel[Chunk.trak_Index]=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_fiel();

Read_Internal_ReadAllInBuffer();

Get_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel->Fields);
Get_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel->Detail);
Get_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel[Chunk.trak_Index]->Fields);
Get_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel[Chunk.trak_Index]->Detail);
}

//***************************************************************************
Expand All @@ -38,7 +40,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_fiel::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -50,8 +52,8 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_fiel::Modify_Internal()
Chunk.Content.Size = 2;
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel->Fields);
Put_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel->Detail);
Put_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel[Chunk.trak_Index]->Fields);
Put_B1(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_fiel[Chunk.trak_Index]->Detail);

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_gama::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx gama blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_gama();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama[Chunk.trak_Index]=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_gama();

Read_Internal_ReadAllInBuffer();

uint32_t Gamma;
Get_B4(Gamma);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama->Gamma=((double)Gamma/(double)(1<<16));
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama[Chunk.trak_Index]->Gamma=((double)Gamma/(double)(1<<16));
}

//***************************************************************************
Expand All @@ -39,7 +41,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_gama::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -51,7 +53,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_gama::Modify_Internal()
Chunk.Content.Size = 4;
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B4((uint32_t)(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama->Gamma*(1<<16)));
Put_B4((uint32_t)(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_gama[Chunk.trak_Index]->Gamma*(1<<16)));

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
20 changes: 11 additions & 9 deletions Source/Common/mp4/mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx mdcv blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv = new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index] = new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv();

Read_Internal_ReadAllInBuffer();

for (size_t c = 0; c < 8; c++)
{
int16u Temp;
Get_B2(Temp);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Primaries[c] = (double)Temp/50000;
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Primaries[c] = (double)Temp/50000;
}

int32u Temp;
Get_B4(Temp);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Luminance[0] = (double)Temp/10000;
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Luminance[0] = (double)Temp/10000;
Get_B4(Temp);
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Luminance[1] = (double)Temp/10000;
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Luminance[1] = (double)Temp/10000;
}

//***************************************************************************
Expand All @@ -49,7 +51,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -62,10 +64,10 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv::Modify_Internal()
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

for (size_t c = 0; c < 8; c++)
Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Primaries[c]*50000));
Put_B2((int16u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Primaries[c]*50000));

Put_B4((int32u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Luminance[0]*10000));
Put_B4((int32u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv->Luminance[1]*10000));
Put_B4((int32u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Luminance[0]*10000));
Put_B4((int32u)round(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_mdcv[Chunk.trak_Index]->Luminance[1]*10000));

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
//---------------------------------------------------------------------------
void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_pasp::Read_Internal()
{
if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp)
Chunk.trak_Index=Global->moov_trak.size()-1;

if (Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp.count(Chunk.trak_Index))
throw exception_read_block("2 moov trak mdia minf stbl stsd xxxx pasp blocks");

Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_pasp();
Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp[Chunk.trak_Index]=new global::block_moov_trak_mdia_minf_stbl_stsd_xxxx_pasp();

Read_Internal_ReadAllInBuffer();

Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp->hSpacing);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp->vSpacing);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp[Chunk.trak_Index]->hSpacing);
Get_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp[Chunk.trak_Index]->vSpacing);
}

//***************************************************************************
Expand All @@ -38,7 +40,7 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_pasp::Modify_Internal()
if (Chunk.Content.IsModified)
return;

if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp)
if (!Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp.count(Chunk.trak_Index))
{
Chunk.Content.IsRemovable = true;
return;
Expand All @@ -50,8 +52,8 @@ void mp4_moov_trak_mdia_minf_stbl_stsd_xxxx_pasp::Modify_Internal()
Chunk.Content.Size = 8;
Chunk.Content.Buffer = new int8u[Chunk.Content.Size];

Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp->hSpacing);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp->vSpacing);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp[Chunk.trak_Index]->hSpacing);
Put_B4(Global->moov_trak_mdia_minf_stbl_stsd_xxxx_pasp[Chunk.trak_Index]->vSpacing);

Chunk.Content.IsModified=true;
Chunk.Content.Size_IsModified=true;
Expand Down
16 changes: 9 additions & 7 deletions Source/Common/mp4/mp4_moov_trak_tapt_xxxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#define mp4_moov_trak_tapt_(name) \
void mp4_moov_trak_tapt_##name::Read_Internal() \
{ \
if (Global->moov_trak_tapt_##name) \
Chunk.trak_Index=Global->moov_trak.size()-1;\
\
if (Global->moov_trak_tapt_##name.count(Chunk.trak_Index)) \
throw exception_read_block("2 moov trak tapt " #name " blocks"); \
\
Global->moov_trak_tapt_##name=new global::block_moov_trak_tapt_xxxx(); \
Global->moov_trak_tapt_##name[Chunk.trak_Index]=new global::block_moov_trak_tapt_xxxx(); \
\
Read_Internal_ReadAllInBuffer(); \
\
Expand All @@ -31,17 +33,17 @@ void mp4_moov_trak_tapt_##name::Read_Internal() \
\
uint32_t Width, Height; \
Get_B4(Width); \
Global->moov_trak_tapt_##name->Width=((double)Width/(double)(1<<16)); \
Global->moov_trak_tapt_##name[Chunk.trak_Index]->Width=((double)Width/(double)(1<<16)); \
Get_B4(Height); \
Global->moov_trak_tapt_##name->Height=((double)Height/(double)(1<<16)); \
Global->moov_trak_tapt_##name[Chunk.trak_Index]->Height=((double)Height/(double)(1<<16)); \
} \
\
void mp4_moov_trak_tapt_##name::Modify_Internal() \
{ \
if (Chunk.Content.IsModified) \
return; \
\
if (!Global->moov_trak_tapt_##name) \
if (!Global->moov_trak_tapt_##name.count(Chunk.trak_Index)) \
{ \
Chunk.Content.IsRemovable = true; \
return; \
Expand All @@ -55,8 +57,8 @@ void mp4_moov_trak_tapt_##name::Modify_Internal() \
\
Put_B1(0x00); \
Put_B3(0x000000); \
Put_B4((uint32_t)(Global->moov_trak_tapt_##name->Width*(1<<16))); \
Put_B4((uint32_t)(Global->moov_trak_tapt_##name->Height*(1<<16))); \
Put_B4((uint32_t)(Global->moov_trak_tapt_##name[Chunk.trak_Index]->Width*(1<<16))); \
Put_B4((uint32_t)(Global->moov_trak_tapt_##name[Chunk.trak_Index]->Height*(1<<16))); \
\
Chunk.Content.IsModified=true; \
Chunk.Content.Size_IsModified=true; \
Expand Down
Loading

0 comments on commit 9ce2063

Please sign in to comment.