From 670d896647d1577b5a9d4cc0faf548eb9c35b73d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 11 Feb 2004 08:12:09 +0000 Subject: [PATCH] Scale the duration to ns precision when reading Matroska files. --- ChangeLog | 5 +++++ src/input/r_matroska.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1655d470..1ce5b5f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-02-11 Moritz Bunkus + + * mkvmerge: bug fix: When reading Matroska files the durations + attached to blocks were lost (e.g. for subtitle tracks). + 2004-02-09 Moritz Bunkus * Released v0.8.3. diff --git a/src/input/r_matroska.cpp b/src/input/r_matroska.cpp index 89e4c20cc..2f7b6960f 100644 --- a/src/input/r_matroska.cpp +++ b/src/input/r_matroska.cpp @@ -1655,7 +1655,7 @@ kax_reader_c::read(generic_packetizer_c *) { duration = static_cast (block_group->FindFirstElt(KaxBlockDuration::ClassInfos, false)); if (duration != NULL) - block_duration = (int64_t)uint64(*duration) / + block_duration = (int64_t)uint64(*duration) * tc_scale / block->NumberFrames(); else if (block_track->v_frate != 0) block_duration = (int64_t)(1000000000.0 / block_track->v_frate); @@ -1679,7 +1679,7 @@ kax_reader_c::read(generic_packetizer_c *) { duration = static_cast (block_group->FindFirstElt(KaxBlockDuration::ClassInfos, false)); if (duration != NULL) - block_duration = (int64_t)uint64(*duration) / + block_duration = (int64_t)uint64(*duration) * tc_scale / block->NumberFrames(); else if (block_track->v_frate != 0) block_duration = (int64_t)(1000000000.0 / block_track->v_frate);