From dd697e5a4985faa47c65005cbc5b4d18b3bd9f6d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 7 Apr 2005 17:15:31 +0000 Subject: [PATCH] Update the "number of samples in this file" header field upon extraction of WAVPACK data. Patch by Steve Lhomme (steve ! lhomme () free ! fr). --- ChangeLog | 4 ++++ src/extract/xtr_wav.cpp | 9 ++++++++- src/extract/xtr_wav.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebc1854f6..1d37b7fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-04-07 Moritz Bunkus + * mkvextract: bug fix: WAVPACK extraction did not update the + "number of samples" header field. Patch by Steve Lhomme (see + AUTHORS). + * mkvmerge: bug fix: RealMedia files contain a "FPS" field in their track headers. Unfortunately this field does not always contain the actual FPS of a video track but the maximum number of diff --git a/src/extract/xtr_wav.cpp b/src/extract/xtr_wav.cpp index 3b036a5df..6784b6fed 100644 --- a/src/extract/xtr_wav.cpp +++ b/src/extract/xtr_wav.cpp @@ -211,5 +211,12 @@ xtr_wavpack4_c::handle_block(KaxBlock &block, void xtr_wavpack4_c::finish_file() { - delete corr_out; + out->setFilePointer(12); + out->write_uint32_le(number_of_samples); + + if (NULL != corr_out) { + corr_out->setFilePointer(12); + corr_out->write_uint32_le(number_of_samples); + delete corr_out; + } } diff --git a/src/extract/xtr_wav.h b/src/extract/xtr_wav.h index 2f9e1161d..1aadc2410 100644 --- a/src/extract/xtr_wav.h +++ b/src/extract/xtr_wav.h @@ -32,7 +32,7 @@ public: class xtr_wavpack4_c: public xtr_base_c { public: - uint64_t number_of_samples; + uint32_t number_of_samples; int extract_blockadd_level; binary version[2]; mm_file_io_c *corr_out;