Commit 3144d146 authored by Steve Lhomme's avatar Steve Lhomme

mkclean: don't write a Cue if there is only one Cluster

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@506 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 0481000a
2010-08-xx
2010-08-16
version 0.5.3:
- write CRC-32 elements on key parts for better file safety (not in unsafe mode)
- don't write a Cue if there is only one Cluster
2010-08-08
version 0.5.2:
......
......@@ -33,7 +33,6 @@
#include "matroska/matroska.h"
/*!
* \todo don't write a Cue if there is only one Cluster
* \todo write the CRC-32 on Clusters too (make it faster in libebml2)
* \todo discards tracks that has the same UID
* \todo remuxing: turn a BlockGroup into a SimpleBlock in v2 profiles and when it makes sense (duration = default track duration) (optimize mode)
......@@ -2168,10 +2167,15 @@ int main(int argc, const char *argv[])
//EBML_ElementUpdateSize(*Cluster, 0, 0);
}
// cues
if (!Live)
{
if (RCues)
// cues
if (ARRAYCOUNT(*Clusters,ebml_element*) < 2)
{
NodeDelete(RCues);
RCues = NULL;
}
else if (RCues)
{
ReduceSize((ebml_element*)RCues);
if (!EBML_MasterCheckMandatory(RCues,0))
......@@ -2183,7 +2187,7 @@ int main(int argc, const char *argv[])
else if (EBML_MasterUseChecksum(RCues,!Unsafe))
EBML_ElementUpdateSize(RCues,0,0);
}
if (!RCues && WTrackInfo)
if (!RCues && WTrackInfo && ARRAYCOUNT(*Clusters,ebml_element*) >= 2)
{
// generate the cues
RCues = (ebml_master*)EBML_ElementCreate(&p,&MATROSKA_ContextCues,0,NULL);
......@@ -2205,6 +2209,7 @@ int main(int argc, const char *argv[])
NextPos += EBML_ElementFullSize((ebml_element*)RCues,0);
MATROSKA_LinkMetaSeekElement(WSeekPoint,(ebml_element*)RCues);
}
// attachements
if (RAttachments)
{
......
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