Ticket #8153: external_subtitle_menu_v2.patch
File external_subtitle_menu_v2.patch, 4.0 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
89 89 #define LOC_WARN QString("NVP(%1), Warning: ").arg(dbg_ident(this),0,36) 90 90 #define LOC_ERR QString("NVP(%1), Error: ").arg(dbg_ident(this),0,36) 91 91 92 uint track_type_to_display_mode[kTrackTypeCount+ 2] =92 uint track_type_to_display_mode[kTrackTypeCount+3] = 93 93 { 94 94 kDisplayNone, 95 95 kDisplayAVSubtitle, … … 98 98 kDisplayTeletextCaptions, 99 99 kDisplayNone, 100 100 kDisplayNUVTeletextCaptions, 101 kDisplayTextSubtitle, 101 102 }; 102 103 103 104 NuppelVideoPlayer::NuppelVideoPlayer(bool muted) … … 1928 1929 1929 1930 // figure out which text type to enable.. 1930 1931 bool captions_found = true; 1931 if (decoder->GetTrackCount(kTrackTypeSubtitle)) 1932 if (textSubtitles.GetSubtitleCount() > 0) 1933 EnableCaptions(kDisplayTextSubtitle, osd_msg); 1934 else if (decoder->GetTrackCount(kTrackTypeSubtitle)) 1932 1935 EnableCaptions(kDisplayAVSubtitle, osd_msg); 1933 else if (textSubtitles.GetSubtitleCount() > 0)1934 EnableCaptions(kDisplayTextSubtitle, osd_msg);1935 1936 else if (db_prefer708 && decoder->GetTrackCount(kTrackTypeCC708)) 1936 1937 EnableCaptions(kDisplayCC708, osd_msg); 1937 1938 else if (decoder->GetTrackCount(kTrackTypeTeletextCaptions)) … … 6754 6755 if (kTrackTypeSubtitle == type) 6755 6756 { 6756 6757 DisableCaptions(textDisplayMode, false); 6757 EnableCaptions(kDisplayAVSubtitle); 6758 EnableCaptions(GetTextSubtitlesCount() > 0 ? 6759 kDisplayTextSubtitle : kDisplayAVSubtitle); 6758 6760 } 6759 6761 else if (kTrackTypeCC708 == type) 6760 6762 { … … 6898 6900 6899 6901 int NuppelVideoPlayer::ChangeTrack(uint type, int dir) 6900 6902 { 6903 if (type == kTrackTypeSubtitle && GetTextSubtitlesCount() > 0) 6904 return SetTrack(type, 0); 6901 6905 QMutexLocker locker(&decoder_change_lock); 6902 6906 6903 6907 if (GetDecoder()) -
libs/libmythtv/NuppelVideoPlayer.h
418 418 bool PosMapFromEnc(unsigned long long start, 419 419 QMap<long long, long long> &posMap); 420 420 421 uint GetTextSubtitlesCount(void) const 422 { 423 return textSubtitles.GetSubtitleCount(); 424 } 425 421 426 protected: 422 427 void DisplayPauseFrame(void); 423 428 void DisplayNormalFrame(void); -
libs/libmythtv/tv_play.cpp
3470 3470 else if (action.left(6) == "TOGGLE") 3471 3471 { 3472 3472 int type = to_track_type(action.mid(6)); 3473 if (type == kTrackTypeSubtitle && 3474 ctx->nvp->GetTextSubtitlesCount() > 0) 3475 type = kTrackTypeTextSubtitle; 3473 3476 if (type == kTrackTypeTeletextMenu) 3474 3477 { 3475 3478 handled = true; … … 10811 10814 typeStr = "SUBTITLE"; 10812 10815 selStr = "SELECTSUBTITLE_"; 10813 10816 grpStr = "SUBTITLEGROUP"; 10814 sel = capmode & kDisplayAVSubtitle;10817 sel = capmode & (kDisplayAVSubtitle | kDisplayTextSubtitle); 10815 10818 } 10816 10819 else if (kTrackTypeCC608 == type) 10817 10820 { … … 10854 10857 } 10855 10858 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 10856 10859 10857 if (tracks.empty()) 10860 if (tracks.empty() && 10861 !(type == kTrackTypeSubtitle && ctx->nvp->GetTextSubtitlesCount() > 0)) 10858 10862 return false; 10859 10863 10860 10864 if ((kTrackTypeAudio == type) && tracks.size() <= 1) … … 10873 10877 (sel && (i == curtrack)) ? 1 : 0, NULL, grpStr); 10874 10878 } 10875 10879 10880 if (type == kTrackTypeSubtitle && ctx->nvp->GetTextSubtitlesCount() > 0) 10881 { 10882 new OSDGenericTree( 10883 tm_item, QObject::tr("Text Subtitles"), selStr + QString::number(1), 10884 sel ? 1 : 0, NULL, grpStr); 10885 } 10886 10876 10887 return true; 10877 10888 } 10878 10889