Ticket #1682: 1682.patch

File 1682.patch, 2.9 KB (added by danielk, 18 years ago)

simpler version

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    15561556{
    15571557    uint origMode = textDisplayMode;
    15581558
     1559    textDesired = enable;
     1560
    15591561    if (!enable)
    15601562    {
    15611563        DisableCaptions(origMode);
     
    54965498    return ret;
    54975499}
    54985500
     5501/** \fn NuppelVideoPlayer::TracksChanged(uint)
     5502 *  \brief This tries to re-enables captions/subtitles if the user
     5503 *         wants them and one of the captions/subtitles tracks has
     5504 *         changed.
     5505 */
     5506void NuppelVideoPlayer::TracksChanged(uint trackType)
     5507{
     5508    if (trackType >= kTrackTypeSubtitle &&
     5509        trackType <= kTrackTypeTeletextCaptions && textDesired)
     5510    {
     5511        SetCaptionsEnabled(textDesired);
     5512    }
     5513}
     5514
    54995515InteractiveTV *NuppelVideoPlayer::GetInteractiveTV(void)
    55005516{
    55015517    if (!interactiveTV && osd && itvEnabled)
  • libs/libmythtv/NuppelVideoPlayer.h

     
    345345    int GetTrack(uint type) const;
    346346    int ChangeTrack(uint type, int dir);
    347347    void ChangeCaptionTrack(int dir);
     348    void TracksChanged(uint trackType);
    348349
    349350    // MHEG/MHI stream selection
    350351    bool ITVHandleAction(const QString &action);
     
    604605
    605606    // Support for captions, teletext, etc. decoded by libav
    606607    QMutex    subtitleLock;
     608    /// This allows us to enable captions/subtitles later if the streams
     609    /// are not immediately available when the video starts playing.
     610    bool      textDesired;
    607611    bool      osdHasSubtitles;
    608612    long long osdSubtitlesExpireAt;
    609613    MythDeque<AVSubtitle> nonDisplayedSubtitles;
  • libs/libmythtv/decoderbase.cpp

     
    824824            return false;
    825825
    826826    tracks[type].push_back(info);
     827
     828    if (GetNVP())
     829        GetNVP()->TracksChanged(type);
     830
    827831    return true;
    828832}
    829833
    830834/** \fn DecoderBase::AutoSelectTrack(uint)
    831835 *  \brief Select best track.
    832836 *
    833  *   If case there's only one track available, always choose it.
     837 *   In case there's only one track available, always choose it.
    834838 *
    835839 *   If there is a user selected track we try to find it.
    836840 *
     
    904908        selTrack = 0;
    905909    }
    906910
     911    int oldTrack = currentTrack[type];
    907912    currentTrack[type] = (selTrack < 0) ? -1 : selTrack;
    908913    StreamInfo tmp = tracks[type][currentTrack[type]];
    909914    selectedTrack[type] = tmp;
     
    917922            .arg(currentTrack[type]+1)
    918923            .arg(iso639_key_toName(lang)).arg(lang));
    919924
     925    if (GetNVP() && (oldTrack != currentTrack[type]))
     926        GetNVP()->TracksChanged(type);
     927
    920928    return selTrack;
    921929}
    922930