Permalink
Browse files

Merge pull request #3638 from Voyager1/fix-dvd-subs

[dvdplayer] Fix streams for DVDs sync with lang settings gui
  • Loading branch information...
2 parents 5894f16 + c3acf40 commit 0018656a6b0a84183db1b33d5b8b59f3506147d1 @Voyager1 Voyager1 committed Nov 19, 2013
@@ -354,6 +354,14 @@ int CDVDInputStreamNavigator::ProcessBlock(uint8_t* dest_buffer, int* read)
//libdvdnav never sets logical, why.. don't know..
event->logical = GetActiveSubtitleStream();
+ /* correct stream ids for disabled subs if needed */
+ if(!IsSubtitleStreamEnabled())
+ {
+ event->physical_letterbox |= 0x80;
+ event->physical_pan_scan |= 0x80;
+ event->physical_wide |= 0x80;
+ }
+
if(event->logical<0 && GetSubTitleStreamCount()>0)
{
/* this will not take effect in this event */
@@ -820,8 +820,8 @@ void CDVDPlayer::OpenDefaultStreams(bool reset)
if(!valid)
CloseAudioStream(true);
- // enable subtitles
- m_dvdPlayerVideo.EnableSubtitle(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn);
+ // enable or disable subtitles
+ SetSubtitleVisible(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn);
// open subtitle stream
SelectionStream as = m_SelectionStreams.Get(STREAM_AUDIO, GetAudioStream());
@@ -842,7 +842,8 @@ void CDVDPlayer::OpenDefaultStreams(bool reset)
if(!valid)
{
CloseSubtitleStream(true);
- SetSubtitleVisible(false);
+ if (m_pInputStream && !(m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || m_pInputStream->IsStreamType(DVDSTREAM_TYPE_BLURAY)))
+ SetSubtitleVisible(false);
}
// open teletext stream
@@ -2985,7 +2986,7 @@ bool CDVDPlayer::OpenAudioStream(int iStream, int source, bool reset)
/* audio normally won't consume full cpu, so let it have prio */
m_dvdPlayerAudio.SetPriority(GetPriority()+1);
- CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = m_SelectionStreams.IndexOf(STREAM_AUDIO, source, iStream);
+ CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = GetAudioStream();
return true;
}
@@ -3170,7 +3171,7 @@ bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
m_CurrentSubtitle.stream = (void*)pStream;
m_CurrentSubtitle.started = false;
- CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = m_SelectionStreams.IndexOf(STREAM_SUBTITLE, source, iStream);
+ CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = GetSubtitle();
return true;
}
@@ -3485,7 +3486,7 @@ int CDVDPlayer::OnDVDNavResult(void* pData, int iMessage)
int iStream = event->physical_wide;
bool visible = !(iStream & 0x80);
- m_dvdPlayerVideo.EnableSubtitle(visible);
+ SetSubtitleVisible(visible);
if (iStream >= 0)
m_dvd.iSelectedSPUStream = (iStream & ~0x80);
@@ -870,8 +870,8 @@ void COMXPlayer::OpenDefaultStreams(bool reset)
if(!valid)
CloseAudioStream(true);
- // enable subtitles
- m_omxPlayerVideo.EnableSubtitle(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn);
+ // enable or disable subtitles
+ SetSubtitleVisible(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn);
// open subtitle stream
OMXSelectionStream as = m_SelectionStreams.Get(STREAM_AUDIO, GetAudioStream());
@@ -892,7 +892,8 @@ void COMXPlayer::OpenDefaultStreams(bool reset)
if(!valid)
{
CloseSubtitleStream(true);
- SetSubtitleVisible(false);
+ if (m_pInputStream && !(m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) || m_pInputStream->IsStreamType(DVDSTREAM_TYPE_BLURAY)))
+ SetSubtitleVisible(false);
}
// open teletext stream
@@ -3235,7 +3236,7 @@ bool COMXPlayer::OpenAudioStream(int iStream, int source, bool reset)
/* software decoding normaly consumes full cpu time so prio it */
m_omxPlayerAudio.SetPriority(GetPriority()+1);
- CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = m_SelectionStreams.IndexOf(STREAM_AUDIO, source, iStream);
+ CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = GetAudioStream();
return true;
}
@@ -3425,7 +3426,7 @@ bool COMXPlayer::OpenSubtitleStream(int iStream, int source)
m_CurrentSubtitle.stream = (void*)pStream;
m_CurrentSubtitle.started = false;
- CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = m_SelectionStreams.IndexOf(STREAM_SUBTITLE, source, iStream);
+ CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = GetSubtitle();
return true;
}
@@ -3749,7 +3750,7 @@ int COMXPlayer::OnDVDNavResult(void* pData, int iMessage)
int iStream = event->physical_wide;
bool visible = !(iStream & 0x80);
- m_omxPlayerVideo.EnableSubtitle(visible);
+ SetSubtitleVisible(visible);
if (iStream >= 0)
m_dvd.iSelectedSPUStream = (iStream & ~0x80);

0 comments on commit 0018656

Please sign in to comment.