From 5f048719ed90394cc129d6a6a1b30e5e08d14309 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 11 Nov 2020 14:46:04 +0100 Subject: [PATCH] allow reading the stored/raw timestamp value of a Block Given the API to get the GlobalTimecode of a Block doesn't handle the floating point value of the TrackTimestampScale (attaching a parent track is not common and even though the value is not directly available unlike a fractional timestampscale), it allows external code to compute the proper timestamp when TrackTimestampScale is not 1.0. --- matroska/KaxBlock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h index 10c28ba..1e04176 100644 --- a/matroska/KaxBlock.h +++ b/matroska/KaxBlock.h @@ -45,6 +45,8 @@ using namespace LIBEBML_NAMESPACE; +#define KAX_BLOCK_STORE_TIMESTAMP + START_LIBMATROSKA_NAMESPACE class KaxCluster; @@ -267,6 +269,8 @@ class MATROSKA_DLL_API KaxInternalBlock : public EbmlBinary { uint64 ClusterPosition() const; + int16 GetStoredTimestamp() const { return LocalTimecode; } + protected: std::vector myBuffers; std::vector SizeList; -- 2.50.1