mkvparser: read track language information
Track::GetLanguageAsUTF8 is implemented to allow the user to choose between available audio and subtitle tracks. Change-Id: I5ec9b1c1c00182da759681ba486cbace46e9b63f
This commit is contained in:
parent
1274be1184
commit
3980cf4159
@ -5440,6 +5440,7 @@ long Track::Create(
|
|||||||
|
|
||||||
Track::Info::Info():
|
Track::Info::Info():
|
||||||
nameAsUTF8(NULL),
|
nameAsUTF8(NULL),
|
||||||
|
language(NULL),
|
||||||
codecId(NULL),
|
codecId(NULL),
|
||||||
codecNameAsUTF8(NULL),
|
codecNameAsUTF8(NULL),
|
||||||
codecPrivate(NULL),
|
codecPrivate(NULL),
|
||||||
@ -5457,6 +5458,9 @@ void Track::Info::Clear()
|
|||||||
delete[] nameAsUTF8;
|
delete[] nameAsUTF8;
|
||||||
nameAsUTF8 = NULL;
|
nameAsUTF8 = NULL;
|
||||||
|
|
||||||
|
delete[] language;
|
||||||
|
language = NULL;
|
||||||
|
|
||||||
delete[] codecId;
|
delete[] codecId;
|
||||||
codecId = NULL;
|
codecId = NULL;
|
||||||
|
|
||||||
@ -5516,6 +5520,9 @@ int Track::Info::Copy(Info& dst) const
|
|||||||
if (int status = CopyStr(&Info::nameAsUTF8, dst))
|
if (int status = CopyStr(&Info::nameAsUTF8, dst))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
if (int status = CopyStr(&Info::language, dst))
|
||||||
|
return status;
|
||||||
|
|
||||||
if (int status = CopyStr(&Info::codecId, dst))
|
if (int status = CopyStr(&Info::codecId, dst))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -5570,6 +5577,11 @@ const char* Track::GetNameAsUTF8() const
|
|||||||
return m_info.nameAsUTF8;
|
return m_info.nameAsUTF8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Track::GetLanguage() const
|
||||||
|
{
|
||||||
|
return m_info.language;
|
||||||
|
}
|
||||||
|
|
||||||
const char* Track::GetCodecNameAsUTF8() const
|
const char* Track::GetCodecNameAsUTF8() const
|
||||||
{
|
{
|
||||||
return m_info.codecNameAsUTF8;
|
return m_info.codecNameAsUTF8;
|
||||||
@ -6607,6 +6619,17 @@ long Tracks::ParseTrackEntry(
|
|||||||
if (status)
|
if (status)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
else if (id == 0x02B59C) //Track Language
|
||||||
|
{
|
||||||
|
const long status = UnserializeString(
|
||||||
|
pReader,
|
||||||
|
pos,
|
||||||
|
size,
|
||||||
|
info.language);
|
||||||
|
|
||||||
|
if (status)
|
||||||
|
return status;
|
||||||
|
}
|
||||||
else if (id == 0x06) //CodecID
|
else if (id == 0x06) //CodecID
|
||||||
{
|
{
|
||||||
const long status = UnserializeString(
|
const long status = UnserializeString(
|
||||||
|
@ -334,6 +334,7 @@ public:
|
|||||||
long GetNumber() const;
|
long GetNumber() const;
|
||||||
unsigned long long GetUid() const;
|
unsigned long long GetUid() const;
|
||||||
const char* GetNameAsUTF8() const;
|
const char* GetNameAsUTF8() const;
|
||||||
|
const char* GetLanguage() const;
|
||||||
const char* GetCodecNameAsUTF8() const;
|
const char* GetCodecNameAsUTF8() const;
|
||||||
const char* GetCodecId() const;
|
const char* GetCodecId() const;
|
||||||
const unsigned char* GetCodecPrivate(size_t&) const;
|
const unsigned char* GetCodecPrivate(size_t&) const;
|
||||||
@ -362,6 +363,7 @@ public:
|
|||||||
long number;
|
long number;
|
||||||
unsigned long long uid;
|
unsigned long long uid;
|
||||||
char* nameAsUTF8;
|
char* nameAsUTF8;
|
||||||
|
char* language;
|
||||||
char* codecId;
|
char* codecId;
|
||||||
char* codecNameAsUTF8;
|
char* codecNameAsUTF8;
|
||||||
unsigned char* codecPrivate;
|
unsigned char* codecPrivate;
|
||||||
|
Loading…
Reference in New Issue
Block a user