@@ -1283,18 +1298,14 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
if(s->pb->seekable){
pb=s->pb;
cluster_size=avio_tell(pb)-mkv->cluster_pos;
cluster_time_limit=5000;
cluster_size_limit=5*1024*1024;
}else{
pb=mkv->dyn_bc;
cluster_size=avio_tell(pb);
cluster_time_limit=1000;
cluster_size_limit=32*1024;
}
if(mkv->cluster_pos&&
(cluster_size>cluster_size_limit||
cluster_time>cluster_time_limit||
(cluster_size>mkv->cluster_size_limit||
cluster_time>mkv->cluster_time_limit||
(codec_type==AVMEDIA_TYPE_VIDEO&&keyframe&&
cluster_size>4*1024))){
av_log(s,AV_LOG_DEBUG,"Starting new cluster at offset %"PRIu64
...
...
@@ -1421,8 +1432,9 @@ static int mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
#define OFFSET(x) offsetof(MatroskaMuxContext, x)
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM
staticconstAVOptionoptions[]={
{"reserve_index_space","Reserve a given amount of space (in bytes) at the beginning "
"of the file for the index (cues).",OFFSET(reserve_cues_space),AV_OPT_TYPE_INT,{.i64=0},0,INT_MAX,FLAGS},
{"reserve_index_space","Reserve a given amount of space (in bytes) at the beginning of the file for the index (cues).",OFFSET(reserve_cues_space),AV_OPT_TYPE_INT,{.i64=0},0,INT_MAX,FLAGS},
{"cluster_size_limit","Store at most the provided amount of bytes in a cluster. ",OFFSET(cluster_size_limit),AV_OPT_TYPE_INT,{.i64=-1},-1,INT_MAX,FLAGS},
{"cluster_time_limit","Store at most the provided number of milliseconds in a cluster.",OFFSET(cluster_time_limit),AV_OPT_TYPE_INT64,{.i64=-1},-1,INT64_MAX,FLAGS},