Skip to content

Commit

Permalink
remove internal bSimple boolean
Browse files Browse the repository at this point in the history
We can check the ID matches the class as we already do on reading.
  • Loading branch information
robUx4 committed Jan 21, 2024
1 parent 65f7277 commit a57e6bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions matroska/KaxBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ DECLARE_MKX_MASTER(KaxBlockGroup)

class MATROSKA_DLL_API KaxInternalBlock : public libebml::EbmlBinary {
public:
KaxInternalBlock(const libebml::EbmlCallbacks & classInfo, bool bSimple)
:libebml::EbmlBinary(classInfo),
bIsSimple(bSimple)
KaxInternalBlock(const libebml::EbmlCallbacks & classInfo)
:libebml::EbmlBinary(classInfo)
{}
KaxInternalBlock(const KaxInternalBlock & ElementToClone);
~KaxInternalBlock() override;
Expand Down Expand Up @@ -261,7 +260,6 @@ class MATROSKA_DLL_API KaxInternalBlock : public libebml::EbmlBinary {
std::uint64_t FirstFrameLocation;

KaxCluster *ParentCluster{nullptr};
bool bIsSimple;

libebml::filepos_t RenderData(libebml::IOCallback & output, bool bForceRender, ShouldWrite writeFilter = WriteSkipDefault) override;
};
Expand All @@ -280,7 +278,7 @@ class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock {
bool bIsKeyframe{true};
bool bIsDiscardable{false};
public:
KaxSimpleBlock() :KaxInternalBlock(KaxSimpleBlock::ClassInfos, true) {}
KaxSimpleBlock() :KaxInternalBlock(KaxSimpleBlock::ClassInfos) {}

void SetKeyframe(bool b_keyframe) { bIsKeyframe = b_keyframe; }
void SetDiscardable(bool b_discard) { bIsDiscardable = b_discard; }
Expand Down
2 changes: 1 addition & 1 deletion src/KaxBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool /* bForceRender
if (mInvisible)
*cursor = 0x08;

if (bIsSimple) {
if (EbmlId(*this) == EBML_ID(KaxSimpleBlock)) {
auto *s = reinterpret_cast<const KaxSimpleBlock*>(this);
if (s->IsKeyframe())
*cursor |= 0x80;
Expand Down

0 comments on commit a57e6bd

Please sign in to comment.