]> granicus.if.org Git - libmatroska/commitdiff
KaxSeekHead: let IndexThis return pointer to newly created KaxSeek object
authorMoritz Bunkus <moritz@bunkus.org>
Mon, 22 Jun 2020 09:55:32 +0000 (11:55 +0200)
committerMoritz Bunkus <moritz@bunkus.org>
Mon, 22 Jun 2020 09:55:32 +0000 (11:55 +0200)
That way the caller can use it for whatever purpose.

matroska/KaxSeekHead.h
src/KaxSeekHead.cpp

index bae3a3abc4faa7806241da8abce3c58bef35eb3c..c6b6a4aa3835e594e2ae935b2d7136ac835100f4 100644 (file)
@@ -60,7 +60,7 @@ DECLARE_MKX_MASTER(KaxSeekHead)
       \brief add an element to index in the Meta Seek data
       \note the element should already be written in the file
     */
-    void IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment);
+    KaxSeek * IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment);
 
     KaxSeek * FindFirstOf(const EbmlCallbacks & Callbacks) const;
     KaxSeek * FindNextOf(const KaxSeek &aPrev) const;
index 6372fe34a43ee7c3e36f81fc15e3ceaea9b8d951..8dfec06c738a226608d19a4e628105c9132cfe81 100644 (file)
@@ -46,7 +46,7 @@ START_LIBMATROSKA_NAMESPACE
 /*!
   \todo verify that the element is not already in the list
 */
-void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment)
+KaxSeek * KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment)
 {
   // create a new point
   auto & aNewPoint = AddNewChild<KaxSeek>(*this);
@@ -59,6 +59,8 @@ void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentS
   binary ID[4];
   ((const EbmlId&)aElt).Fill(ID);
   aNewID.CopyBuffer(ID, EBML_ID_LENGTH((const EbmlId&)aElt));
+
+  return &aNewPoint;
 }
 
 KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const