Commit 7e2aa304 authored by Steve Lhomme's avatar Steve Lhomme

mkclean: turn lzo1x and bzlib track compression into zlib by default

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@555 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 67d9a3cb
......@@ -1490,7 +1490,6 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, stream *Input)
{
ARRAYBEGIN(Element->SizeList,int32_t)[0] = outSize;
ArrayResize(&Element->Data,outSize,0);
//EBML_IntegerSetValue(Header,MATROSKA_BLOCK_COMPR_ZLIB); // no writing to LZO1X supported, so force it to ZLIB later
}
}
}
......@@ -1659,7 +1658,6 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, stream *Input)
OutSize += outSize;
ARRAYBEGIN(Element->SizeList,int32_t)[NumFrame] = outSize;
ArrayResize(&Element->Data,OutSize,0);
//EBML_IntegerSetValue(Header,MATROSKA_BLOCK_COMPR_ZLIB); // no writing to LZO1X supported, so force it to ZLIB later
}
}
}
......@@ -1698,7 +1696,6 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, stream *Input)
BZ2_bzDecompressEnd(&stream);
if (Res != BZ_STREAM_END)
Err = ERR_INVALID_DATA;
//EBML_IntegerSetValue(Header,MATROSKA_BLOCK_COMPR_ZLIB); // no writing to BZ2 supported, so force it to ZLIB later
}
}
#endif
......
......@@ -2150,6 +2150,32 @@ int main(int argc, const char *argv[])
}
}
}
else
{
// turn bz2/lzo into zlib
Elt2 = EBML_MasterFindFirstElt(RLevel1,&MATROSKA_ContextTrackEncodings,0,0);
if (Elt2!=NULL)
{
ebml_master *TmpElt = (ebml_master*)EBML_MasterFindFirstElt((ebml_master*)Elt2, &MATROSKA_ContextTrackEncoding, 1, 1);
if (EBML_MasterChildren(TmpElt))
{
TmpElt = (ebml_master*)EBML_MasterFindFirstElt(TmpElt, &MATROSKA_ContextTrackEncodingCompression, 1, 1);
if (EBML_MasterChildren(TmpElt))
{
ebml_element *Algo = (ebml_element*)EBML_MasterFindFirstElt(TmpElt, &MATROSKA_ContextTrackEncodingCompressionAlgo, 1, 1);
if (Algo && EBML_IntegerValue(Algo)!=MATROSKA_BLOCK_COMPR_HEADER && EBML_IntegerValue(Algo)!=MATROSKA_BLOCK_COMPR_ZLIB)
{
NodeDelete((node*)Elt2);
Elt2 = EBML_MasterFindFirstElt(RLevel1,&MATROSKA_ContextTrackEncodings,1,1);
Elt2 = EBML_MasterFindFirstElt((ebml_master*)Elt2,&MATROSKA_ContextTrackEncoding,1,1);
Elt = EBML_MasterFindFirstElt((ebml_master*)Elt2,&MATROSKA_ContextTrackEncodingCompression,1,1);
Elt2 = EBML_MasterFindFirstElt((ebml_master*)Elt,&MATROSKA_ContextTrackEncodingCompressionAlgo,1,1);
EBML_IntegerSetValue((ebml_integer*)Elt2,MATROSKA_BLOCK_COMPR_ZLIB);
}
}
}
}
}
Elt = EBML_MasterFindFirstElt(RLevel1,&MATROSKA_ContextTrackEncodings,0,0);
if (Elt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment