Skip to content

Commit

Permalink
MatroskaSplitter - добавлена поддержка парсинга BCP47 language tag, п…
Browse files Browse the repository at this point in the history
…ока не используется. Косметика/корректировка кода.
  • Loading branch information
Aleksoid1978 committed Dec 2, 2024
1 parent 4b337b8 commit 00b5591
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
12 changes: 11 additions & 1 deletion src/filters/parser/MatroskaSplitter/MatroskaFile.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
* (C) 2006-2023 see Authors.txt
* (C) 2006-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand Down Expand Up @@ -461,6 +461,9 @@ HRESULT TrackEntry::Parse(CMatroskaNode* pMN0)
case 0x22B59C:
Language.Parse(pMN);
break;
case 0x22B59D:
LanguageBCP47.Parse(pMN);
break;
case 0x86:
CodecID.Parse(pMN);
break;
Expand Down Expand Up @@ -1188,6 +1191,9 @@ HRESULT ChapterDisplay::Parse(CMatroskaNode* pMN0)
case 0x437C:
ChapLanguage.Parse(pMN);
break;
case 0x437D:
ChapLanguageBCP47.Parse(pMN);
break;
case 0x437E:
ChapCountry.Parse(pMN);
break;
Expand All @@ -1208,6 +1214,7 @@ HRESULT Tag::Parse(CMatroskaNode* pMN0)
BeginChunk
case 0x67C8:
SimpleTag.Parse(pMN);
break;
case 0x63C0:
Targets.Parse(pMN);
break;
Expand All @@ -1223,6 +1230,9 @@ HRESULT SimpleTag::Parse(CMatroskaNode* pMN0)
case 0x447A:
TagLanguage.Parse(pMN);
break;
case 0x447B:
TagLanguageBCP47.Parse(pMN);
break;
case 0x4487:
TagString.Parse(pMN);
break;
Expand Down
19 changes: 7 additions & 12 deletions src/filters/parser/MatroskaSplitter/MatroskaFile.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
* (C) 2006-2023 see Authors.txt
* (C) 2006-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand Down Expand Up @@ -461,7 +461,8 @@ namespace MatroskaReader
CUInt FlagEnabled, FlagDefault, FlagLacing, FlagForced;
CUInt MinCache, MaxCache;
CUTF8 Name;
CANSI Language;
CANSI Language{ "eng" };
CANSI LanguageBCP47;
CBinary CodecID;
CBinary CodecPrivate;
CUTF8 CodecName;
Expand All @@ -488,7 +489,6 @@ namespace MatroskaReader
FlagForced.Set(0);
MinCache.Set(0);
TrackTimecodeScale.Set(1.0f);
Language.CStringA::operator = ("eng");
MaxBlockAdditionID.Set(0);
CodecDecodeAll.Set(1);
}
Expand Down Expand Up @@ -574,12 +574,10 @@ namespace MatroskaReader
{
public:
CUTF8 ChapString;
CANSI ChapLanguage;
CANSI ChapLanguage{ "eng" };
CANSI ChapLanguageBCP47;
CANSI ChapCountry;

ChapterDisplay() {
ChapLanguage.CStringA::operator = ("eng");
}
HRESULT Parse(CMatroskaNode* pMN);
};

Expand Down Expand Up @@ -636,13 +634,10 @@ namespace MatroskaReader
{
public:
CUTF8 TagName;
CANSI TagLanguage;
CANSI TagLanguage{ "und" };
CANSI TagLanguageBCP47;
CUTF8 TagString;

SimpleTag() {
TagLanguage.CStringA::operator = ("eng");
}

HRESULT Parse(CMatroskaNode* pMN);
};

Expand Down

0 comments on commit 00b5591

Please sign in to comment.