mkvparser: Get frame default duration
Track::GetDefaultDuration is implemented as an alternative to VideoTrack::GetFrameRate which seems to be deprecated. Change-Id: I2c7a6d56a232125b8632d87eab75b9600c5451e1
This commit is contained in:
committed by
Johan Redestig
parent
64cee42b85
commit
a9f43fe8e7
@@ -5580,6 +5580,7 @@ int Track::Info::Copy(Info& dst) const
|
||||
|
||||
dst.type = type;
|
||||
dst.number = number;
|
||||
dst.defaultDuration = defaultDuration;
|
||||
dst.uid = uid;
|
||||
dst.lacing = lacing;
|
||||
dst.settings = settings;
|
||||
@@ -5678,6 +5679,10 @@ bool Track::GetLacing() const
|
||||
return m_info.lacing;
|
||||
}
|
||||
|
||||
unsigned long long Track::GetDefaultDuration() const
|
||||
{
|
||||
return m_info.defaultDuration;
|
||||
}
|
||||
|
||||
long Track::GetFirst(const BlockEntry*& pBlockEntry) const
|
||||
{
|
||||
@@ -6579,6 +6584,7 @@ long Tracks::ParseTrackEntry(
|
||||
info.type = 0;
|
||||
info.number = 0;
|
||||
info.uid = 0;
|
||||
info.defaultDuration = 0;
|
||||
|
||||
Track::Settings v;
|
||||
v.start = -1;
|
||||
@@ -6693,6 +6699,15 @@ long Tracks::ParseTrackEntry(
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
else if (id == 0x03E383) //Default Duration
|
||||
{
|
||||
const long long duration = UnserializeUInt(pReader, pos, size);
|
||||
|
||||
if (duration < 0)
|
||||
return E_FILE_FORMAT_INVALID;
|
||||
|
||||
info.defaultDuration = static_cast<unsigned long long>(duration);
|
||||
}
|
||||
else if (id == 0x06) //CodecID
|
||||
{
|
||||
const long status = UnserializeString(
|
||||
|
||||
@@ -354,6 +354,7 @@ public:
|
||||
const char* GetCodecId() const;
|
||||
const unsigned char* GetCodecPrivate(size_t&) const;
|
||||
bool GetLacing() const;
|
||||
unsigned long long GetDefaultDuration() const;
|
||||
|
||||
const BlockEntry* GetEOS() const;
|
||||
|
||||
@@ -377,6 +378,7 @@ public:
|
||||
long type;
|
||||
long number;
|
||||
unsigned long long uid;
|
||||
unsigned long long defaultDuration;
|
||||
char* nameAsUTF8;
|
||||
char* language;
|
||||
char* codecId;
|
||||
|
||||
Reference in New Issue
Block a user