diff options
author | elupus <elupus@svn> | 2010-10-13 23:18:12 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2010-10-13 23:18:12 +0000 |
commit | 9e9f4d3772d81586e563d73dda789a9521d6b15a (patch) | |
tree | 786d4675410125395c9c6761098bc3d33e15934c | |
parent | 44af75ced1b04da83ae53439185e4b3597d99a7a (diff) |
changed: always mark the first external subtitle file found as default
This makes that external subtitle have priority over any internal subtitles in a file marked as default
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@34751 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.cpp | 9 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index ba1dcde54e..b51be0a772 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -458,7 +458,7 @@ bool CDVDPlayer::OpenInputStream() filenames.push_back(m_item.GetProperty(key)); for(unsigned int i=0;i<filenames.size();i++) - AddSubtitleFile(filenames[i]); + AddSubtitleFile(filenames[i], i == 0 ? CDemuxStream::FLAG_DEFAULT : CDemuxStream::FLAG_NONE); g_settings.m_currentVideoSettings.m_SubtitleCached = true; } @@ -3360,7 +3360,7 @@ int CDVDPlayer::GetSourceBitrate() } -int CDVDPlayer::AddSubtitleFile(const std::string& filename) +int CDVDPlayer::AddSubtitleFile(const std::string& filename, CDemuxStream::EFlags flags) { std::string ext = CUtil::GetExtension(filename); if(ext == ".idx") @@ -3369,7 +3369,9 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename) if(!v.Open(filename)) return -1; m_SelectionStreams.Update(NULL, &v); - return m_SelectionStreams.IndexOf(STREAM_SUBTITLE, m_SelectionStreams.Source(STREAM_SOURCE_DEMUX_SUB, filename), 0); + int index = m_SelectionStreams.IndexOf(STREAM_SUBTITLE, m_SelectionStreams.Source(STREAM_SOURCE_DEMUX_SUB, filename), 0); + m_SelectionStreams.Get(STREAM_SUBTITLE, index).flags = flags; + return index; } if(ext == ".sub") { @@ -3383,6 +3385,7 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename) s.id = 0; s.filename = filename; s.name = CUtil::GetFileName(filename); + s.flags = flags; m_SelectionStreams.Update(s); return m_SelectionStreams.IndexOf(STREAM_SUBTITLE, s.source, s.id); } diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h index 134b85e6c2..1a9286cd58 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -250,7 +250,7 @@ protected: void ProcessSubData(CDemuxStream* pStream, DemuxPacket* pPacket); void ProcessTeletextData(CDemuxStream* pStream, DemuxPacket* pPacket); - int AddSubtitleFile(const std::string& filename); + int AddSubtitleFile(const std::string& filename, CDemuxStream::EFlags flags = CDemuxStream::FLAG_NONE); /** * one of the DVD_PLAYSPEED defines */ |