]> granicus.if.org Git - libmatroska/commitdiff
allow reading the stored/raw timestamp value of a Block block-timestamp
authorSteve Lhomme <robux4@ycbcr.xyz>
Wed, 11 Nov 2020 13:46:04 +0000 (14:46 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Wed, 11 Nov 2020 13:51:21 +0000 (14:51 +0100)
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

index 10c28bad8c82aa22854b16d3292f588d0c22f165..1e04176ec3c0228eec82b6f22ca25582c44f44ec 100644 (file)
@@ -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<DataBuffer *> myBuffers;
     std::vector<int32>        SizeList;