diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2011-12-03 17:47:40 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2011-12-03 17:47:40 +0400 |
commit | a57b95993949656236b352ebd66db1ecf2eaf7d5 (patch) | |
tree | 48e9aeca7c0e105b03eb67115eb67543351393bd /src/filters | |
parent | 77ac6e1d1ded3bbb455dcb29cc7e045530ebb277 (diff) |
Add : Support language info for Subtitle stream on .IFO play;
Small code refactoring;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3876 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters')
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitter.cpp | 32 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitterFile.cpp | 6 |
2 files changed, 6 insertions, 32 deletions
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 0d5d7ff70..a25ea35f5 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -854,17 +854,9 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
- CString lang_str;
CString lang_name = _T("");
- if((m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_str)) && (!lang_str.IsEmpty())) {
- char ch[4];
- ch[0] = lang_str[0];
- ch[1] = lang_str[1];
- ch[2] = lang_str[2];
- ch[3] = lang_str[3];
- lang_name = ISO6392ToLanguage(ch);
- }
-
+ m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_name);
+
lang_name = pTI ? pTI->GetTrackName(s.ps1id) : lang_name;
CString FormatDesc = GetMediaTypeDesc(&s.mt, pClipInfo, StreamType, lang_name);
@@ -941,16 +933,8 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
- CString lang_str;
CString lang_name = _T("");
- if((m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_str)) && (!lang_str.IsEmpty())) {
- char ch[4];
- ch[0] = lang_str[0];
- ch[1] = lang_str[1];
- ch[2] = lang_str[2];
- ch[3] = lang_str[3];
- lang_name = ISO6392ToLanguage(ch);
- }
+ m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_name);
lang_name = pTI ? pTI->GetTrackName(s.ps1id) : lang_name;
@@ -1379,16 +1363,8 @@ STDMETHODIMP CMpegSplitterFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
- CString lang_str;
CString lang_name = _T("");
- if((m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_str)) && (!lang_str.IsEmpty())) {
- char ch[4];
- ch[0] = lang_str[0];
- ch[1] = lang_str[1];
- ch[2] = lang_str[2];
- ch[3] = lang_str[3];
- lang_name = ISO6392ToLanguage(ch);
- }
+ m_pFile->m_pPMT_Lang.Lookup(s.pid, lang_name);
lang_name = pTI ? pTI->GetTrackName(s.ps1id) : lang_name;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index b6299a069..bc2b910f0 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -913,15 +913,13 @@ void CMpegSplitterFile::UpdatePrograms(CGolombBuffer gb, WORD pid, bool UpdateLa case 0x0a: // ISO 639 language descriptor
case 0x56: // Teletext descriptor
case 0x59: // Subtitling descriptor
- ch[0] = gb.BitRead(8);
- ch[1] = gb.BitRead(8);
- ch[2] = gb.BitRead(8);
+ gb.ReadBuffer((BYTE *)ch, 3);
ch[3] = 0;
for(int i = 3; i < descriptor_length; i++) {
gb.BitRead(8);
}
if(!(ch[0] == 'u' && ch[1] == 'n' && ch[2] == 'd')) {
- m_pPMT_Lang[pid] = CString(ch);
+ m_pPMT_Lang[pid] = ISO6392ToLanguage(ch);
}
break;
default:
|