diff --git a/matroska/matroskacontainer.cpp b/matroska/matroskacontainer.cpp index 7863f8c..0a81a67 100644 --- a/matroska/matroskacontainer.cpp +++ b/matroska/matroskacontainer.cpp @@ -52,6 +52,26 @@ MatroskaContainer::MatroskaContainer(MediaFileInfo &fileInfo, uint64 startOffset MatroskaContainer::~MatroskaContainer() {} +void MatroskaContainer::reset() +{ + GenericContainer::reset(); + m_maxIdLength = 4; + m_maxSizeLength = 8; + m_version = 1; + m_readVersion = 1; + m_doctype = "matroska"; + m_doctypeVersion = 1; + m_doctypeReadVersion = 1; + m_tracksElements.clear(); + m_segmentInfoElements.clear(); + m_tagsElements.clear(); + m_chaptersElements.clear(); + m_attachmentsElements.clear(); + m_seekInfos.clear(); + m_editionEntries.clear(); + m_attachments.clear(); +} + /*! * \brief Validates the file index (cue entries). * \remarks Checks only for cluster positions and missing, unknown or surplus elements. diff --git a/matroska/matroskacontainer.h b/matroska/matroskacontainer.h index 435b4cc..aae60ad 100644 --- a/matroska/matroskacontainer.h +++ b/matroska/matroskacontainer.h @@ -42,6 +42,8 @@ public: MatroskaAttachment *attachment(std::size_t index); std::size_t attachmentCount() const; + void reset(); + protected: void internalParseHeader(); void internalParseTags(); diff --git a/mp4/mp4container.cpp b/mp4/mp4container.cpp index 4fe0184..f81b446 100644 --- a/mp4/mp4container.cpp +++ b/mp4/mp4container.cpp @@ -38,6 +38,12 @@ Mp4Container::Mp4Container(MediaFileInfo &fileInfo, uint64 startOffset) : Mp4Container::~Mp4Container() {} +void Mp4Container::reset() +{ + GenericContainer::reset(); + m_fragmented = false; +} + void Mp4Container::internalParseHeader() { //const string context("parsing header of MP4 container"); will be used when generating notifications diff --git a/mp4/mp4container.h b/mp4/mp4container.h index c560bf3..76e9250 100644 --- a/mp4/mp4container.h +++ b/mp4/mp4container.h @@ -24,6 +24,7 @@ public: bool supportsTrackModifications() const; bool isFragmented() const; + void reset(); protected: void internalParseHeader(); diff --git a/ogg/oggcontainer.cpp b/ogg/oggcontainer.cpp index 7fd5730..53244b2 100644 --- a/ogg/oggcontainer.cpp +++ b/ogg/oggcontainer.cpp @@ -31,6 +31,12 @@ OggContainer::OggContainer(MediaFileInfo &fileInfo, uint64 startOffset) : OggContainer::~OggContainer() {} +void OggContainer::reset() +{ + m_commentTable.clear(); + m_iterator.reset(); +} + void OggContainer::internalParseHeader() { static const string context("parsing OGG bitstream header"); diff --git a/ogg/oggcontainer.h b/ogg/oggcontainer.h index 80195ff..c95fd47 100644 --- a/ogg/oggcontainer.h +++ b/ogg/oggcontainer.h @@ -45,6 +45,7 @@ public: bool isChecksumValidationEnabled() const; void setChecksumValidationEnabled(bool enabled); + void reset(); protected: void internalParseHeader();