Skip to content

Commit

Permalink
Merge pull request #2825 from ace20022/sub_fixes
Browse files Browse the repository at this point in the history
[Fix/Subtitles] Fix wrong indices of erroneous subtitles.
  • Loading branch information
Voyager1 committed Jun 6, 2013
2 parents 143d5ab + f9fff03 commit f937d8a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions xbmc/cores/dvdplayer/DVDPlayer.cpp
Expand Up @@ -3055,6 +3055,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);
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion xbmc/interfaces/json-rpc/PlayerOperations.cpp
Expand Up @@ -43,6 +43,7 @@
#include "pvr/channels/PVRChannel.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "cores/IPlayer.h"
#include "settings/MediaSettings.h"

using namespace JSONRPC;
using namespace PLAYLIST;
Expand Down Expand Up @@ -1438,7 +1439,7 @@ JSONRPC_STATUS CPlayerOperations::GetPropertyValue(PlayerType player, const CStd
if (g_application.m_pPlayer)
{
result = CVariant(CVariant::VariantTypeObject);
int index = g_application.m_pPlayer->GetSubtitle();
int index = CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream;
if (index >= 0)
{
SPlayerSubtitleStreamInfo info;
Expand Down
3 changes: 2 additions & 1 deletion xbmc/interfaces/legacy/Player.cpp
Expand Up @@ -30,6 +30,7 @@
#include "AddonUtils.h"
#include "utils/log.h"
#include "cores/IPlayer.h"
#include "settings/MediaSettings.h"

namespace XBMCAddon
{
Expand Down Expand Up @@ -396,7 +397,7 @@ namespace XBMCAddon
if (g_application.m_pPlayer)
{
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(g_application.m_pPlayer->GetSubtitle(), info);
g_application.m_pPlayer->GetSubtitleStreamInfo(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream, info);

if (info.language.length() > 0)
return info.language;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/PlayerController.cpp
Expand Up @@ -64,7 +64,7 @@ bool CPlayerController::OnAction(const CAction &action)
if (CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleOn)
{
SPlayerSubtitleStreamInfo info;
g_application.m_pPlayer->GetSubtitleStreamInfo(g_application.m_pPlayer->GetSubtitle(), info);
g_application.m_pPlayer->GetSubtitleStreamInfo(CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream, info);
if (!g_LangCodeExpander.Lookup(lang, info.language))
lang = g_localizeStrings.Get(13205); // Unknown

Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
Expand Up @@ -200,7 +200,7 @@ void CGUIDialogAudioSubtitleSettings::AddSubtitleStreams(unsigned int id)
setting.type = SettingInfo::SPIN;
setting.min = 0;
setting.data = &m_subtitleStream;
m_subtitleStream = g_application.m_pPlayer->GetSubtitle();
m_subtitleStream = CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream;

if(m_subtitleStream < 0) m_subtitleStream = 0;

Expand Down

0 comments on commit f937d8a

Please sign in to comment.