fix compilation with libEBML/libMatroska v2.0

This commit is contained in:
Moritz Bunkus 2023-12-31 16:05:18 +01:00
parent 522f46f472
commit 506bda2aa9
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 23 additions and 8 deletions

View File

@ -31,14 +31,19 @@ kax_reference_block_c::UpdateSize(
bool bSaveDefault,
#endif
bool bForceRender) {
#if LIBEBML_VERSION >= 0x020000
if (!bTimestampSet) {
assert(-1 != m_value);
SetValue((m_value - static_cast<int64_t>(ParentBlock->GlobalTimecode())) / static_cast<int64_t>(ParentBlock->GlobalTimecodeScale()));
}
return libebml::EbmlSInteger::UpdateSize(writeFilter, bForceRender);
#else
if (!bTimecodeSet) {
assert(-1 != m_value);
SetValue((m_value - static_cast<int64_t>(ParentBlock->GlobalTimecode())) / static_cast<int64_t>(ParentBlock->GlobalTimecodeScale()));
}
#if LIBEBML_VERSION >= 0x020000
return libebml::EbmlSInteger::UpdateSize(writeFilter, bForceRender);
#else
return libebml::EbmlSInteger::UpdateSize(bSaveDefault, bForceRender);
#endif
}

View File

@ -28,18 +28,32 @@
class kax_cluster_c: public libmatroska::KaxCluster {
public:
kax_cluster_c(): libmatroska::KaxCluster() {
#if LIBMATROSKA_VERSION >= 0x020000
PreviousTimestamp = 0;
#else
PreviousTimecode = 0;
#endif
}
virtual ~kax_cluster_c();
void delete_non_blocks();
#if LIBMATROSKA_VERSION >= 0x020000
void set_min_timestamp(int64_t min_timestamp) {
MinTimestamp = min_timestamp;
}
void set_max_timestamp(int64_t max_timestamp) {
MaxTimestamp = max_timestamp;
}
#else
void set_min_timestamp(int64_t min_timestamp) {
MinTimecode = min_timestamp;
}
void set_max_timestamp(int64_t max_timestamp) {
MaxTimecode = max_timestamp;
}
#endif
};
class kax_reference_block_c: public libmatroska::KaxReferenceBlock {
@ -50,12 +64,8 @@ public:
kax_reference_block_c();
void set_value(int64_t value) {
m_value = value;
#if LIBEBML_VERSION < 0x000800
bValueIsSet = true;
#else
m_value = value;
SetValueIsSet();
#endif
}
#if LIBEBML_VERSION >= 0x020000