aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-09-08 06:21:00 +0000
committerjmarshallnz <jmarshallnz@svn>2010-09-08 06:21:00 +0000
commit482a52efb98ce0ea2fa624cc1debec4c74f90b78 (patch)
treebd1ff9a30e4ba8a61f4b69014b747c05a0fd0e88
parent25f1f00c3be7ce1995b05588ba93def4e96d4726 (diff)
merged: r33533, r33535, r33553, r33580 from trunk:
reverted: listitem.duration back to minutes. (cherry picked from commit e895fd90b92baebbe972fb05fbdd348fcd355c6f) fixed: Ensure we don't divide by zero in the scrollbar positioning code. (cherry picked from commit 160f6a7699ae7903839075cd2daea464e183bf69) readded: support for loading old, depreciated <episodeguide>&lt;episodeguide style episodeguide tags. NOTE: Support for these will be eventually removed - you should re-export your library. (cherry picked from commit abab9dd69ee3f2cc02ddc080d1fb5f6400e8dd9c) removed: aac/mp1/mp2/mp3 passthrough options from the UI. (cherry picked from commit 464c62dc0f28c521f946539c9dae73b2be5fd14e) git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@33606 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--guilib/GUIScrollBarControl.cpp6
-rw-r--r--xbmc/GUISettings.cpp16
-rw-r--r--xbmc/GUIWindowSettingsCategory.cpp8
-rw-r--r--xbmc/VideoInfoTag.cpp12
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp8
-rw-r--r--xbmc/utils/GUIInfoManager.cpp2
6 files changed, 29 insertions, 23 deletions
diff --git a/guilib/GUIScrollBarControl.cpp b/guilib/GUIScrollBarControl.cpp
index 42ddbaa014..a74dfc72fb 100644
--- a/guilib/GUIScrollBarControl.cpp
+++ b/guilib/GUIScrollBarControl.cpp
@@ -195,7 +195,7 @@ void CGUIScrollBar::UpdateBarSize()
if (m_orientation == VERTICAL)
{
// calculate the height to display the nib at
- float percent = (float)m_pageSize / m_numItems;
+ float percent = (m_numItems == 0) ? 0 : (float)m_pageSize / m_numItems;
float nibSize = GetHeight() * percent;
if (nibSize < m_guiNibFocus.GetTextureHeight() + 2 * MIN_NIB_SIZE) nibSize = m_guiNibFocus.GetTextureHeight() + 2 * MIN_NIB_SIZE;
if (nibSize > GetHeight()) nibSize = GetHeight();
@@ -220,7 +220,7 @@ void CGUIScrollBar::UpdateBarSize()
else
{
// calculate the height to display the nib at
- float percent = (float)m_pageSize / m_numItems;
+ float percent = (m_numItems == 0) ? 0 : (float)m_pageSize / m_numItems;
float nibSize = GetWidth() * percent + 0.5f;
if (nibSize < m_guiNibFocus.GetTextureWidth() + 2 * MIN_NIB_SIZE) nibSize = m_guiNibFocus.GetTextureWidth() + 2 * MIN_NIB_SIZE;
if (nibSize > GetWidth()) nibSize = GetWidth();
@@ -231,7 +231,7 @@ void CGUIScrollBar::UpdateBarSize()
m_guiNibFocus.SetWidth(nibSize);
// and the position
- percent = (float)m_offset / (m_numItems - m_pageSize);
+ percent = (m_numItems == m_pageSize) ? 0 : (float)m_offset / (m_numItems - m_pageSize);
float nibPos = (GetWidth() - nibSize) * percent;
if (nibPos < 0) nibPos = 0;
if (nibPos > GetWidth() - nibSize) nibPos = GetWidth() - nibSize;
diff --git a/xbmc/GUISettings.cpp b/xbmc/GUISettings.cpp
index a17647dbb2..c26b9fada5 100644
--- a/xbmc/GUISettings.cpp
+++ b/xbmc/GUISettings.cpp
@@ -435,10 +435,10 @@ void CGUISettings::Initialize()
AddBool(ao, "audiooutput.ac3passthrough", 364, true);
AddBool(ao, "audiooutput.dtspassthrough", 254, true);
- AddBool(ao, "audiooutput.aacpassthrough", 299, false);
- AddBool(ao, "audiooutput.mp1passthrough", 300, false);
- AddBool(ao, "audiooutput.mp2passthrough", 301, false);
- AddBool(ao, "audiooutput.mp3passthrough", 302, false);
+ AddBool(NULL, "audiooutput.passthroughaac", 299, false);
+ AddBool(NULL, "audiooutput.passthroughmp1", 300, false);
+ AddBool(NULL, "audiooutput.passthroughmp2", 301, false);
+ AddBool(NULL, "audiooutput.passthroughmp3", 302, false);
#ifdef __APPLE__
AddString(ao, "audiooutput.audiodevice", 545, "Default", SPIN_CONTROL_TEXT);
@@ -1089,10 +1089,10 @@ void CGUISettings::LoadXML(TiXmlElement *pRootElement, bool hideSettings /* = fa
CLog::Log(LOGINFO, "Using %s output", GetInt("audiooutput.mode") == AUDIO_ANALOG ? "analog" : "digital");
CLog::Log(LOGINFO, "AC3 pass through is %s", GetBool("audiooutput.ac3passthrough") ? "enabled" : "disabled");
CLog::Log(LOGINFO, "DTS pass through is %s", GetBool("audiooutput.dtspassthrough") ? "enabled" : "disabled");
- CLog::Log(LOGINFO, "AAC pass through is %s", GetBool("audiooutput.aacpassthrough") ? "enabled" : "disabled");
- CLog::Log(LOGINFO, "MP1 pass through is %s", GetBool("audiooutput.mp1passthrough") ? "enabled" : "disabled");
- CLog::Log(LOGINFO, "MP2 pass through is %s", GetBool("audiooutput.mp2passthrough") ? "enabled" : "disabled");
- CLog::Log(LOGINFO, "MP3 pass through is %s", GetBool("audiooutput.mp3passthrough") ? "enabled" : "disabled");
+ CLog::Log(LOGINFO, "AAC pass through is %s", GetBool("audiooutput.passthroughaac") ? "enabled" : "disabled");
+ CLog::Log(LOGINFO, "MP1 pass through is %s", GetBool("audiooutput.passthroughmp1") ? "enabled" : "disabled");
+ CLog::Log(LOGINFO, "MP2 pass through is %s", GetBool("audiooutput.passthroughmp2") ? "enabled" : "disabled");
+ CLog::Log(LOGINFO, "MP3 pass through is %s", GetBool("audiooutput.passthroughmp3") ? "enabled" : "disabled");
g_guiSettings.m_LookAndFeelResolution = GetResolution();
#ifdef __APPLE__
diff --git a/xbmc/GUIWindowSettingsCategory.cpp b/xbmc/GUIWindowSettingsCategory.cpp
index a8f44dd54c..e0c489f2e8 100644
--- a/xbmc/GUIWindowSettingsCategory.cpp
+++ b/xbmc/GUIWindowSettingsCategory.cpp
@@ -790,10 +790,10 @@ void CGUIWindowSettingsCategory::UpdateSettings()
strSetting.Equals("audiooutput.passthroughdevice") ||
strSetting.Equals("audiooutput.ac3passthrough") ||
strSetting.Equals("audiooutput.dtspassthrough") ||
- strSetting.Equals("audiooutput.aacpassthrough") ||
- strSetting.Equals("audiooutput.mp1passthrough") ||
- strSetting.Equals("audiooutput.mp2passthrough") ||
- strSetting.Equals("audiooutput.mp3passthrough"))
+ strSetting.Equals("audiooutput.passthroughaac") ||
+ strSetting.Equals("audiooutput.passthroughmp1") ||
+ strSetting.Equals("audiooutput.passthroughmp2") ||
+ strSetting.Equals("audiooutput.passthroughmp3"))
{ // only visible if we are in digital mode
CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
if (pControl) pControl->SetEnabled(AUDIO_IS_BITSTREAM(g_guiSettings.GetInt("audiooutput.mode")));
diff --git a/xbmc/VideoInfoTag.cpp b/xbmc/VideoInfoTag.cpp
index 9835b83775..0699a7e5cb 100644
--- a/xbmc/VideoInfoTag.cpp
+++ b/xbmc/VideoInfoTag.cpp
@@ -541,9 +541,15 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie)
const TiXmlElement *epguide = movie->FirstChildElement("episodeguide");
if (epguide)
{
- stringstream stream;
- stream << *epguide;
- m_strEpisodeGuide = stream.str();
+ // DEPRECIATE ME - support for old XML-encoded <episodeguide> blocks.
+ if (epguide->FirstChild() && strnicmp("<episodeguide", epguide->FirstChild()->Value(), 13) == 0)
+ m_strEpisodeGuide = epguide->FirstChild()->Value();
+ else
+ {
+ stringstream stream;
+ stream << *epguide;
+ m_strEpisodeGuide = stream.str();
+ }
}
// fanart
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
index 2d35c2bfe8..b5f521ae81 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
@@ -329,10 +329,10 @@ bool CDVDAudioCodecPassthroughFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptio
{
m_bSupportsAC3Out = g_guiSettings.GetBool("audiooutput.ac3passthrough");
m_bSupportsDTSOut = g_guiSettings.GetBool("audiooutput.dtspassthrough");
- m_bSupportsAACOut = g_guiSettings.GetBool("audiooutput.aacpassthrough");
- m_bSupportsMP1Out = g_guiSettings.GetBool("audiooutput.mp1passthrough");
- m_bSupportsMP2Out = g_guiSettings.GetBool("audiooutput.mp2passthrough");
- m_bSupportsMP3Out = g_guiSettings.GetBool("audiooutput.mp3passthrough");
+ m_bSupportsAACOut = g_guiSettings.GetBool("audiooutput.passthroughaac");
+ m_bSupportsMP1Out = g_guiSettings.GetBool("audiooutput.passthroughmp1");
+ m_bSupportsMP2Out = g_guiSettings.GetBool("audiooutput.passthroughmp2");
+ m_bSupportsMP3Out = g_guiSettings.GetBool("audiooutput.passthroughmp3");
}
else
return false;
diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp
index d6dfdf1fc2..255a81d5b5 100644
--- a/xbmc/utils/GUIInfoManager.cpp
+++ b/xbmc/utils/GUIInfoManager.cpp
@@ -3782,7 +3782,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
if (item->HasVideoInfoTag())
{
if (item->GetVideoInfoTag()->m_streamDetails.GetVideoDuration() > 0)
- duration = StringUtils::SecondsToTimeString(item->GetVideoInfoTag()->m_streamDetails.GetVideoDuration());
+ duration.Format("%i", item->GetVideoInfoTag()->m_streamDetails.GetVideoDuration() / 60);
else if (!item->GetVideoInfoTag()->m_strRuntime.IsEmpty())
duration = item->GetVideoInfoTag()->m_strRuntime;
}