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:
Patrik2 Carlsson
2013-05-02 16:03:20 +02:00
committed by Johan Redestig
parent 64cee42b85
commit a9f43fe8e7
2 changed files with 17 additions and 0 deletions

View File

@@ -5580,6 +5580,7 @@ int Track::Info::Copy(Info& dst) const
dst.type = type; dst.type = type;
dst.number = number; dst.number = number;
dst.defaultDuration = defaultDuration;
dst.uid = uid; dst.uid = uid;
dst.lacing = lacing; dst.lacing = lacing;
dst.settings = settings; dst.settings = settings;
@@ -5678,6 +5679,10 @@ bool Track::GetLacing() const
return m_info.lacing; return m_info.lacing;
} }
unsigned long long Track::GetDefaultDuration() const
{
return m_info.defaultDuration;
}
long Track::GetFirst(const BlockEntry*& pBlockEntry) const long Track::GetFirst(const BlockEntry*& pBlockEntry) const
{ {
@@ -6579,6 +6584,7 @@ long Tracks::ParseTrackEntry(
info.type = 0; info.type = 0;
info.number = 0; info.number = 0;
info.uid = 0; info.uid = 0;
info.defaultDuration = 0;
Track::Settings v; Track::Settings v;
v.start = -1; v.start = -1;
@@ -6693,6 +6699,15 @@ long Tracks::ParseTrackEntry(
if (status) if (status)
return 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 else if (id == 0x06) //CodecID
{ {
const long status = UnserializeString( const long status = UnserializeString(

View File

@@ -354,6 +354,7 @@ public:
const char* GetCodecId() const; const char* GetCodecId() const;
const unsigned char* GetCodecPrivate(size_t&) const; const unsigned char* GetCodecPrivate(size_t&) const;
bool GetLacing() const; bool GetLacing() const;
unsigned long long GetDefaultDuration() const;
const BlockEntry* GetEOS() const; const BlockEntry* GetEOS() const;
@@ -377,6 +378,7 @@ public:
long type; long type;
long number; long number;
unsigned long long uid; unsigned long long uid;
unsigned long long defaultDuration;
char* nameAsUTF8; char* nameAsUTF8;
char* language; char* language;
char* codecId; char* codecId;