mkvmerge: extend file by right amount when rewriting track headers

The number of bytes the file will grow by is "delta", not the amount of
bytes having to be relocated.

Partial fix for #1498; also applies to #1485.
This commit is contained in:
Moritz Bunkus 2015-11-15 22:47:36 +01:00
parent 3cfbd77d4c
commit 90ea8cee82
2 changed files with 2 additions and 2 deletions

View File

@ -730,7 +730,7 @@ relocate_written_data(uint64_t data_start_pos,
// end and starting to write from there won't work with most of the
// mm_io_c-derived classes.
s_out->save_pos(s_out->get_size());
auto dummy_data = std::make_unique<std::string>(to_relocate, '\0');
auto dummy_data = std::make_unique<std::string>(delta, '\0');
s_out->write(dummy_data->c_str(), dummy_data->length());
s_out->restore_pos();

View File

@ -352,5 +352,5 @@ T_503pcm_in_mkv_varying_samples_per_packet:81c000712108e2a604c8a30b7677606f:pass
T_504dts_96_24_identification:1837ab5b411944e143f9dae6fe6436d8-bb7c41b5aa1b57f18741b792897b0b59-90994a65c6f828ecfead9bd6473453a2:passed:20151006-223804:2.278995107
T_505cisco_talos_can_0036:bf0fedc494cf99a0920d7a6e69edf952-6ef415b0f84d3e5dd435244362a37584:passed:20151020-161153:0.071686357
T_506cisco_talos_can_0037:5461288548eac976164cd13f01bc9426-ed695caee29b1456da8629d38321ec9c-92b7169fc05ddf54c46816869c108f31-54a55a6d87bd4c08269891efb03980b3-fef3d018523c7d1fbed763f6666c1ae2-ac584cc44854f9396739df6e93d78acc-b415b2ef2a6dddf5d89733446fae2970-dd53fee23372c569d35e0b2918d86239:passed:20151020-161234:0.319298931
T_507rerender_track_headers:7b16f08b7858a1d332516a6fb25a184b-ac9514a1f09f26ac0cb2f527ec2de0b7:passed:20151022-104930:2.573204876
T_507rerender_track_headers:7b16f08b7858a1d332516a6fb25a184b-180751296d662c5c5691f712803feecc:passed:20151022-104930:2.573204876
T_508splitting_by_parts_with_segment_linking:existence0-true-true-true-existence1-true-true-true-existence2-true-true-true-equality_previous-true-true-equality_next-true-true:passed:20151103-204257:0.111807853