mkvmuxer: Fix Segment::Finalize in kLive mode

Do not call Cluster::Finalize in kLive mode unless
accurate_cluster_duration_ is set.

Change-Id: Id2627b5df9eaee065e12d08b494ee02ae0a33564
This commit is contained in:
Vignesh Venkatasubramanian 2016-04-15 20:20:09 -07:00
parent 6df3e5630e
commit 87832d487a

View File

@ -2970,7 +2970,10 @@ bool Segment::Finalize() {
if (WriteFramesAll() < 0)
return false;
if (cluster_list_size_ > 0) {
// In kLive mode, call Cluster::Finalize only if |accurate_cluster_duration_|
// is set. In all other modes, always call Cluster::Finalize.
if ((mode_ == kLive ? accurate_cluster_duration_ : true) &&
cluster_list_size_ > 0) {
// Update last cluster's size
Cluster* const old_cluster = cluster_list_[cluster_list_size_ - 1];