diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index e942389..022d7ea 100644
|
a
|
b
|
void AvFormatDecoder::DoFastForwardSeek(long long desiredFrame, bool &needflush)
|
| 2240 | 2240 | DecoderBase::DoFastForwardSeek(desiredFrame, needflush); |
| 2241 | 2241 | return; |
| 2242 | 2242 | } |
| | 2243 | ///Returns TeleText language |
| | 2244 | int AvFormatDecoder::GetTeletextLanguage(uint lang_idx) |
| | 2245 | { |
| | 2246 | for (uint i = 0; i < (uint) tracks[kTrackTypeTeletextCaptions].size(); i++) |
| | 2247 | { |
| | 2248 | if (tracks[kTrackTypeTeletextCaptions][i].language_index == lang_idx) |
| | 2249 | { |
| | 2250 | return tracks[kTrackTypeTeletextCaptions][i].language; |
| | 2251 | } |
| | 2252 | } |
| 2243 | 2253 | |
| | 2254 | return iso639_str3_to_key("und"); |
| | 2255 | } |
| 2244 | 2256 | /// Returns DVD Subtitle language |
| 2245 | 2257 | int AvFormatDecoder::GetSubtitleLanguage(uint subtitle_index, uint stream_index) |
| 2246 | 2258 | { |
diff --git a/mythtv/libs/libmythtv/avformatdecoder.h b/mythtv/libs/libmythtv/avformatdecoder.h
index aa3f9d1..a9e214b 100644
|
a
|
b
|
class AvFormatDecoder : public DecoderBase
|
| 176 | 176 | virtual bool SetVideoByComponentTag(int tag); |
| 177 | 177 | |
| 178 | 178 | // Stream language info |
| | 179 | virtual int GetTeletextLanguage(uint lang_idx); |
| 179 | 180 | virtual int GetSubtitleLanguage(uint subtitle_index, uint stream_index); |
| 180 | 181 | virtual int GetCaptionLanguage(TrackTypes trackType, int service_num); |
| 181 | 182 | virtual int GetAudioLanguage(uint audio_index, uint stream_index); |
diff --git a/mythtv/libs/libmythtv/mythccextractorplayer.cpp b/mythtv/libs/libmythtv/mythccextractorplayer.cpp
index ef8aeac..90dc761 100644
|
a
|
b
|
void MythCCExtractorPlayer::Process608Captions(uint flags)
|
| 363 | 363 | |
| 364 | 364 | QString lang = iso639_key_to_str3(langCode); |
| 365 | 365 | lang = iso639_is_key_undefined(langCode) ? "und" : lang; |
| 366 | | |
| | 366 | |
| 367 | 367 | QString service_key = QString("cc%1").arg(idx + 1); |
| 368 | 368 | QString filename = QString("%1.%2%3-%4.%5.srt") |
| 369 | 369 | .arg(m_baseName).arg(stream_id_str).arg("608") |
| … |
… |
void MythCCExtractorPlayer::IngestTeletext(void)
|
| 557 | 557 | to_string_list(*subpage)); |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | | |
| | 560 | |
| 561 | 561 | (*ttxit).reader->ClearUpdatedPages(); |
| 562 | 562 | } |
| 563 | 563 | } |
| … |
… |
void MythCCExtractorPlayer::ProcessTeletext(void)
|
| 578 | 578 | if ((*it).empty()) |
| 579 | 579 | continue; // Skip empty subtitle streams. |
| 580 | 580 | |
| 581 | | int page = it.key(); |
| | 581 | uint page = it.key(); |
| 582 | 582 | |
| 583 | 583 | if (!(*ttxit).srtwriters[page]) |
| 584 | 584 | { |
| 585 | | QString filename = QString("%1.%2ttx-0x%3.srt") |
| | 585 | int langCode = 0; |
| | 586 | AvFormatDecoder *avd = dynamic_cast<AvFormatDecoder *>(decoder); |
| | 587 | |
| | 588 | if (avd) |
| | 589 | langCode = avd->GetTeletextLanguage(page); |
| | 590 | |
| | 591 | QString lang = iso639_key_to_str3(langCode); |
| | 592 | lang = iso639_is_key_undefined(langCode) ? "und" : lang; |
| | 593 | QString filename = QString("%1-%2.%3ttx-0x%4.srt") |
| 586 | 594 | .arg(m_baseName) |
| | 595 | .arg(lang) |
| 587 | 596 | .arg(stream_id_str) |
| 588 | 597 | .arg(page, 3, 16, QChar('0')); |
| 589 | 598 | |
| … |
… |
void MythCCExtractorPlayer::IngestDVBSubtitles(void)
|
| 645 | 654 | subtitles->buffers.pop_front(); |
| 646 | 655 | |
| 647 | 656 | const QSize v_size = |
| 648 | | QSize(GetVideoSize().width()*4, GetVideoSize().height()*4); |
| | 657 | QSize(GetVideoSize().width()*4, GetVideoSize().height()*4); |
| 649 | 658 | QImage sub_pict(v_size, QImage::Format_ARGB32); |
| 650 | 659 | sub_pict.fill(0); |
| 651 | 660 | |
| … |
… |
void MythCCExtractorPlayer::ProcessDVBSubtitles(uint flags)
|
| 714 | 723 | { |
| 715 | 724 | // Process (DVB) subtitle streams. |
| 716 | 725 | DVBSubInfo::iterator subit = m_dvbsub_info.begin(); |
| | 726 | int subtitleStreamCount = 0; |
| 717 | 727 | for (; subit != m_dvbsub_info.end(); ++subit) |
| 718 | 728 | { |
| 719 | | QString dir_name = QString(m_baseName + ".dvb-%1").arg(subit.key()); |
| | 729 | int langCode = 0; |
| | 730 | AvFormatDecoder *avd = dynamic_cast<AvFormatDecoder *>(decoder); |
| | 731 | int idx = subit.key(); |
| | 732 | if (avd) |
| | 733 | langCode = avd->GetSubtitleLanguage(subtitleStreamCount, idx); |
| | 734 | subtitleStreamCount++; |
| | 735 | |
| | 736 | QString lang = iso639_key_to_str3(langCode); |
| | 737 | lang = iso639_is_key_undefined(langCode) ? "und" : lang; |
| | 738 | QString dir_name = QString(m_baseName + "-%1.dvb-%2").arg(lang).arg(subit.key()); |
| 720 | 739 | if (!m_workingDir.exists(dir_name) && !m_workingDir.mkdir(dir_name)) |
| 721 | 740 | { |
| 722 | 741 | LOG(VB_GENERAL, LOG_ERR, QString("Can't create directory '%1'") |