mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
Matroska reader: fix timestamp-based progress calculation when appending
When appending m_last_timecode is already offset by m_first_timecode. Therefore subtracting it once more during the progress calculation will result in negative numbers if m_first_timecode is non-zero – which is the case when appending files created by splitting with linking enabled, for example.
This commit is contained in:
parent
ee39d23a7f
commit
9e70ebd83c
@ -1,5 +1,11 @@
|
||||
2015-12-19 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* mkvmerge: bug fix: the progress calculation was sometimes
|
||||
outputting negative numbers when appending Matroska files whose
|
||||
timestamps don't start at 0 (e.g. if they were created by
|
||||
splitting with linking enabled). In the the GUI this resulted in
|
||||
lines like "#GUI#progress -2%" in the job's output.
|
||||
|
||||
* mkvpropedit: new feature: added an option for removing all
|
||||
existing track statistics tags from a file. Part of the
|
||||
implementation of #1507.
|
||||
|
@ -2230,7 +2230,7 @@ kax_reader_c::process_block_group(KaxCluster *cluster,
|
||||
int
|
||||
kax_reader_c::get_progress() {
|
||||
if (0 != m_segment_duration)
|
||||
return (m_last_timecode - std::max(m_first_timecode, static_cast<int64_t>(0))) * 100 / m_segment_duration;
|
||||
return std::min(m_last_timecode, m_segment_duration) * 100 / m_segment_duration;
|
||||
|
||||
return 100 * m_in->getFilePointer() / m_size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user