mirror of
https://github.com/libretro/Lakka.git
synced 2024-12-03 13:40:56 +00:00
xbmc (frodo): switch to own repo
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
8bbc662083
commit
ad9c750f57
@ -19,7 +19,7 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="xbmc-theme-Confluence"
|
||||
PKG_VERSION="12.2.0"
|
||||
PKG_VERSION="12.2-9064b9b"
|
||||
if [ "$XBMC" = "master" ]; then
|
||||
PKG_VERSION="c218d5c"
|
||||
elif [ "$XBMC" = "xbmc-aml" ]; then
|
||||
|
@ -19,7 +19,7 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="xbmc"
|
||||
PKG_VERSION="12.2.0"
|
||||
PKG_VERSION="12.2-9064b9b"
|
||||
if [ "$XBMC" = "master" ]; then
|
||||
PKG_VERSION="c218d5c"
|
||||
elif [ "$XBMC" = "xbmc-aml" ]; then
|
||||
|
@ -0,0 +1,746 @@
|
||||
From 1a93a46fe38c926ccd7658ce6f8c827d0491c117 Mon Sep 17 00:00:00 2001
|
||||
From: stupid-boy <amushatov@gmail.com>
|
||||
Date: Wed, 13 Feb 2013 23:47:07 +0200
|
||||
Subject: [PATCH 1/2] [OMXPlayer] Both HDMI and Analog output
|
||||
|
||||
---
|
||||
xbmc/cores/omxplayer/OMXAudio.cpp | 407 +++++++++++++++++++++++++-------
|
||||
xbmc/cores/omxplayer/OMXAudio.h | 12 +-
|
||||
xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 9 +-
|
||||
xbmc/settings/GUISettings.cpp | 2 +
|
||||
xbmc/settings/GUISettings.h | 3 +
|
||||
5 files changed, 341 insertions(+), 92 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
index 10c3329..1470685 100644
|
||||
--- a/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
+++ b/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
@@ -111,8 +111,7 @@
|
||||
m_eEncoding (OMX_AUDIO_CodingPCM),
|
||||
m_extradata (NULL ),
|
||||
m_extrasize (0 ),
|
||||
- m_last_pts (DVD_NOPTS_VALUE),
|
||||
- m_omx_render (NULL )
|
||||
+ m_last_pts (DVD_NOPTS_VALUE)
|
||||
{
|
||||
m_vizBufferSize = m_vizRemapBufferSize = VIS_PACKET_SIZE * sizeof(float);
|
||||
m_vizRemapBuffer = (uint8_t *)_aligned_malloc(m_vizRemapBufferSize,16);
|
||||
@@ -161,7 +160,7 @@ CAEChannelInfo COMXAudio::GetChannelLayout(AEAudioFormat format)
|
||||
return info;
|
||||
}
|
||||
|
||||
-bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *clock, CDVDStreamInfo &hints, bool bUsePassthrough, bool bUseHWDecode)
|
||||
+bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo &hints, bool bUsePassthrough, bool bUseHWDecode)
|
||||
{
|
||||
Deinitialize();
|
||||
|
||||
@@ -320,32 +319,62 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
|
||||
|
||||
componentName = "OMX.broadcom.audio_render";
|
||||
|
||||
- if(!m_omx_render)
|
||||
- m_omx_render = new COMXCoreComponent();
|
||||
- if(!m_omx_render)
|
||||
+ std::string device = "";
|
||||
+
|
||||
+ if((g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI) ||
|
||||
+ (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_BOTH))
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::Initialize error allocate OMX.broadcom.audio_render\n");
|
||||
- return false;
|
||||
+ device = "hdmi";
|
||||
+ if(!m_omx_render_HDMI.Initialize((const std::string)componentName, OMX_IndexParamAudioInit))
|
||||
+ return false;
|
||||
+
|
||||
+ OMX_CONFIG_BRCMAUDIODESTINATIONTYPE audioDest;
|
||||
+ OMX_INIT_STRUCTURE(audioDest);
|
||||
+ strncpy((char *)audioDest.sName, device.c_str(), strlen(device.c_str()));
|
||||
+
|
||||
+ omx_err = m_omx_render_HDMI.SetConfig(OMX_IndexConfigBrcmAudioDestination, &audioDest);
|
||||
+ if (omx_err != OMX_ErrorNone)
|
||||
+ return false;
|
||||
+
|
||||
+ OMX_CONFIG_BOOLEANTYPE configBool;
|
||||
+ OMX_INIT_STRUCTURE(configBool);
|
||||
+ configBool.bEnabled = OMX_FALSE;
|
||||
+
|
||||
+ omx_err = m_omx_render_HDMI.SetConfig(OMX_IndexConfigBrcmClockReferenceSource, &configBool);
|
||||
+ if (omx_err != OMX_ErrorNone)
|
||||
+ return false;
|
||||
}
|
||||
|
||||
- if(!m_omx_render->Initialize((const std::string)componentName, OMX_IndexParamAudioInit))
|
||||
- return false;
|
||||
+ if((g_guiSettings.GetInt("audiooutput.mode") == AUDIO_ANALOG) ||
|
||||
+ (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_BOTH))
|
||||
+ {
|
||||
+ device = "local";
|
||||
+ if(!m_omx_render_analog.Initialize((const std::string)componentName, OMX_IndexParamAudioInit))
|
||||
+ return false;
|
||||
|
||||
- OMX_CONFIG_BRCMAUDIODESTINATIONTYPE audioDest;
|
||||
- OMX_INIT_STRUCTURE(audioDest);
|
||||
- strncpy((char *)audioDest.sName, device.c_str(), strlen(device.c_str()));
|
||||
+ OMX_CONFIG_BRCMAUDIODESTINATIONTYPE audioDest;
|
||||
+ OMX_INIT_STRUCTURE(audioDest);
|
||||
+ strncpy((char *)audioDest.sName, device.c_str(), strlen(device.c_str()));
|
||||
|
||||
- omx_err = m_omx_render->SetConfig(OMX_IndexConfigBrcmAudioDestination, &audioDest);
|
||||
- if (omx_err != OMX_ErrorNone)
|
||||
- return false;
|
||||
+ omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigBrcmAudioDestination, &audioDest);
|
||||
+ if (omx_err != OMX_ErrorNone)
|
||||
+ return false;
|
||||
|
||||
- OMX_CONFIG_BOOLEANTYPE configBool;
|
||||
- OMX_INIT_STRUCTURE(configBool);
|
||||
- configBool.bEnabled = OMX_FALSE;
|
||||
+ OMX_CONFIG_BOOLEANTYPE configBool;
|
||||
+ OMX_INIT_STRUCTURE(configBool);
|
||||
+ configBool.bEnabled = OMX_FALSE;
|
||||
|
||||
- omx_err = m_omx_render->SetConfig(OMX_IndexConfigBrcmClockReferenceSource, &configBool);
|
||||
- if (omx_err != OMX_ErrorNone)
|
||||
- return false;
|
||||
+ omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigBrcmClockReferenceSource, &configBool);
|
||||
+ if (omx_err != OMX_ErrorNone)
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if(g_guiSettings.GetInt("audiooutput.mode") == AUDIO_BOTH)
|
||||
+ {
|
||||
+ componentName = "OMX.broadcom.audio_splitter";
|
||||
+ if(!m_omx_splitter.Initialize((const std::string)componentName, OMX_IndexParamAudioInit))
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
componentName = "OMX.broadcom.audio_decode";
|
||||
if(!m_omx_decoder.Initialize((const std::string)componentName, OMX_IndexParamAudioInit))
|
||||
@@ -411,13 +440,30 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
|
||||
}
|
||||
}
|
||||
|
||||
- m_omx_tunnel_clock.Initialize(m_omx_clock, m_omx_clock->GetInputPort(), m_omx_render, m_omx_render->GetInputPort()+1);
|
||||
+ if( m_omx_render_analog.IsInitialized())
|
||||
+ {
|
||||
+ m_omx_tunnel_clock_analog.Initialize(m_omx_clock, m_omx_clock->GetInputPort(),
|
||||
+ &m_omx_render_analog, m_omx_render_analog.GetInputPort()+1);
|
||||
|
||||
- omx_err = m_omx_tunnel_clock.Establish(false);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ omx_err = m_omx_tunnel_clock_analog.Establish(false, true);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize m_omx_tunnel_clock_analog.Establish\n");
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if( m_omx_render_HDMI.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::Initialize m_omx_tunnel_clock.Establish\n");
|
||||
- return false;
|
||||
+ m_omx_tunnel_clock_HDMI.Initialize(m_omx_clock, m_omx_clock->GetInputPort()+ ( m_omx_render_analog.IsInitialized() ? 2 : 0),
|
||||
+ &m_omx_render_HDMI, m_omx_render_HDMI.GetInputPort()+1);
|
||||
+
|
||||
+ omx_err = m_omx_tunnel_clock_HDMI.Establish(false, true);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize m_omx_tunnel_clock_HDMI.Establish\n");
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
omx_err = m_omx_decoder.AllocInputBuffers();
|
||||
@@ -443,12 +489,56 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
|
||||
return false;
|
||||
}
|
||||
|
||||
- m_omx_tunnel_mixer.Initialize(&m_omx_mixer, m_omx_mixer.GetOutputPort(), m_omx_render, m_omx_render->GetInputPort());
|
||||
- omx_err = m_omx_tunnel_mixer.Establish(false);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ if(g_guiSettings.GetInt("audiooutput.mode") == AUDIO_ANALOG)
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_decoder.Establish 0x%08x", omx_err);
|
||||
- return false;
|
||||
+ m_omx_tunnel_mixer.Initialize(&m_omx_mixer, m_omx_mixer.GetOutputPort(),
|
||||
+ &m_omx_render_analog, m_omx_render_analog.GetInputPort());
|
||||
+ omx_err = m_omx_tunnel_mixer.Establish(false);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_decoder.Establish 0x%08x", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ else if (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI)
|
||||
+ {
|
||||
+ m_omx_tunnel_mixer.Initialize(&m_omx_mixer, m_omx_mixer.GetOutputPort(),
|
||||
+ &m_omx_render_HDMI, m_omx_render_HDMI.GetInputPort());
|
||||
+ omx_err = m_omx_tunnel_mixer.Establish(false);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_decoder.Establish 0x%08x", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ else // AUDIO_BOTH
|
||||
+ {
|
||||
+ m_omx_tunnel_mixer.Initialize(&m_omx_mixer, m_omx_mixer.GetOutputPort(),
|
||||
+ &m_omx_splitter, m_omx_splitter.GetInputPort());
|
||||
+ omx_err = m_omx_tunnel_mixer.Establish(false);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_mixer.Establish 0x%08x", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ m_omx_tunnel_splitter_analog.Initialize(&m_omx_splitter, m_omx_splitter.GetOutputPort(),
|
||||
+ &m_omx_render_analog, m_omx_render_analog.GetInputPort());
|
||||
+ omx_err = m_omx_tunnel_splitter_analog.Establish(false);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_splitter_analog.Establish 0x%08x", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ m_omx_tunnel_splitter_HDMI.Initialize(&m_omx_splitter, m_omx_splitter.GetOutputPort() + 1,
|
||||
+ &m_omx_render_HDMI, m_omx_render_HDMI.GetInputPort());
|
||||
+ omx_err = m_omx_tunnel_splitter_HDMI.Establish(false);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_splitter_HDMI.Establish 0x%08x", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
omx_err = m_omx_mixer.SetStateForComponent(OMX_StateExecuting);
|
||||
@@ -459,7 +549,9 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
|
||||
}
|
||||
else
|
||||
{
|
||||
- m_omx_tunnel_decoder.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), m_omx_render, m_omx_render->GetInputPort());
|
||||
+ // Passthrough work only for HDMI
|
||||
+ m_omx_tunnel_decoder.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(),
|
||||
+ &m_omx_render_HDMI, m_omx_render_HDMI.GetInputPort());
|
||||
omx_err = m_omx_tunnel_decoder.Establish(false);
|
||||
if(omx_err != OMX_ErrorNone)
|
||||
{
|
||||
@@ -474,11 +566,34 @@ bool COMXAudio::Initialize(AEAudioFormat format, std::string& device, OMXClock *
|
||||
}
|
||||
}
|
||||
|
||||
- omx_err = m_omx_render->SetStateForComponent(OMX_StateExecuting);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ if ( m_omx_splitter.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::Initialize - Error setting OMX_StateExecuting 0x%08x", omx_err);
|
||||
- return false;
|
||||
+ omx_err = m_omx_splitter.SetStateForComponent(OMX_StateExecuting);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error setting OMX_StateExecuting 0x%08x for m_omx_splitter", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ( m_omx_render_analog.IsInitialized())
|
||||
+ {
|
||||
+ omx_err = m_omx_render_analog.SetStateForComponent(OMX_StateExecuting);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error setting OMX_StateExecuting 0x%08x for m_omx_render_analog", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ( m_omx_render_HDMI.IsInitialized())
|
||||
+ {
|
||||
+ omx_err = m_omx_render_HDMI.SetStateForComponent(OMX_StateExecuting);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::Initialize - Error setting OMX_StateExecuting 0x%08x for m_omx_render_HDMI", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
m_omx_decoder.EnablePort(m_omx_decoder.GetInputPort(), true);
|
||||
@@ -570,9 +685,12 @@ bool COMXAudio::Deinitialize()
|
||||
m_omx_tunnel_decoder.Flush();
|
||||
if(!m_Passthrough)
|
||||
m_omx_tunnel_mixer.Flush();
|
||||
- m_omx_tunnel_clock.Flush();
|
||||
|
||||
- m_omx_tunnel_clock.Deestablish();
|
||||
+ m_omx_tunnel_clock_analog.Flush();
|
||||
+ m_omx_tunnel_clock_HDMI.Flush();
|
||||
+ m_omx_tunnel_clock_analog.Deestablish();
|
||||
+ m_omx_tunnel_clock_HDMI.Deestablish();
|
||||
+
|
||||
if(!m_Passthrough)
|
||||
{
|
||||
// workaround for the strange BCM mixer component
|
||||
@@ -587,8 +705,16 @@ bool COMXAudio::Deinitialize()
|
||||
|
||||
m_omx_decoder.FlushInput();
|
||||
|
||||
- if(m_omx_render)
|
||||
- m_omx_render->Deinitialize(true);
|
||||
+ m_omx_tunnel_splitter_analog.Flush();
|
||||
+ m_omx_tunnel_splitter_analog.Deestablish(true);
|
||||
+ m_omx_tunnel_splitter_HDMI.Flush();
|
||||
+ m_omx_tunnel_splitter_HDMI.Deestablish(true);
|
||||
+
|
||||
+ m_omx_splitter.Deinitialize(true);
|
||||
+
|
||||
+ m_omx_render_analog.Deinitialize(true);
|
||||
+ m_omx_render_HDMI.Deinitialize(true);
|
||||
+
|
||||
if(!m_Passthrough)
|
||||
m_omx_mixer.Deinitialize(true);
|
||||
m_omx_decoder.Deinitialize(true);
|
||||
@@ -613,9 +739,6 @@ bool COMXAudio::Deinitialize()
|
||||
m_first_frame = true;
|
||||
m_last_pts = DVD_NOPTS_VALUE;
|
||||
|
||||
- delete m_omx_render;
|
||||
- m_omx_render = NULL;
|
||||
-
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -696,7 +819,7 @@ void COMXAudio::Mute(bool bMute)
|
||||
//***********************************************************************************************
|
||||
bool COMXAudio::SetCurrentVolume(float fVolume)
|
||||
{
|
||||
- CSingleLock lock (m_critSection);
|
||||
+CSingleLock lock (m_critSection);
|
||||
|
||||
if(!m_Initialized || m_Passthrough)
|
||||
return false;
|
||||
@@ -754,22 +877,39 @@ bool COMXAudio::SetCurrentVolume(float fVolume)
|
||||
{
|
||||
OMX_AUDIO_CONFIG_VOLUMETYPE volume;
|
||||
OMX_INIT_STRUCTURE(volume);
|
||||
- volume.nPortIndex = m_omx_render->GetInputPort();
|
||||
+ OMX_ERRORTYPE omx_err;
|
||||
|
||||
volume.bLinear = OMX_TRUE;
|
||||
float hardwareVolume = fVolume * gain * 100.0f;
|
||||
volume.sVolume.nValue = (int)(hardwareVolume + 0.5f);
|
||||
|
||||
- OMX_ERRORTYPE omx_err =
|
||||
- m_omx_render->SetConfig(OMX_IndexConfigAudioVolume, &volume);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ if(m_omx_render_analog.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "%s::%s - error setting OMX_IndexConfigAudioVolume, error 0x%08x\n",
|
||||
+ volume.nPortIndex = m_omx_render_analog.GetInputPort();
|
||||
+ omx_err = m_omx_render_analog.SetConfig(OMX_IndexConfigAudioVolume, &volume);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "%s::%s - error setting OMX_IndexConfigAudioVolume, error 0x%08x for m_omx_render_analog\n",
|
||||
CLASSNAME, __func__, omx_err);
|
||||
- return false;
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ if(m_omx_render_HDMI.IsInitialized())
|
||||
+ {
|
||||
+ volume.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
+ omx_err = m_omx_render_HDMI.SetConfig(OMX_IndexConfigAudioVolume, &volume);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "%s::%s - error setting OMX_IndexConfigAudioVolume, error 0x%08x for m_omx_render_HDMI\n",
|
||||
+ CLASSNAME, __func__, omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
}
|
||||
return true;
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -927,7 +1067,18 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
m_first_frame = false;
|
||||
//m_omx_render.WaitForEvent(OMX_EventPortSettingsChanged);
|
||||
|
||||
- m_omx_render->DisablePort(m_omx_render->GetInputPort(), false);
|
||||
+ if(m_omx_render_analog.IsInitialized())
|
||||
+ m_omx_render_analog.DisablePort(m_omx_render_analog.GetInputPort(), false);
|
||||
+ if(m_omx_render_HDMI.IsInitialized())
|
||||
+ m_omx_render_HDMI.DisablePort(m_omx_render_HDMI.GetInputPort(), false);
|
||||
+
|
||||
+ if(m_omx_splitter.IsInitialized())
|
||||
+ {
|
||||
+ m_omx_splitter.DisablePort(m_omx_splitter.GetOutputPort(), false);
|
||||
+ m_omx_splitter.DisablePort(m_omx_splitter.GetOutputPort()+1, false);
|
||||
+ m_omx_splitter.DisablePort(m_omx_splitter.GetInputPort(), false);
|
||||
+ }
|
||||
+
|
||||
if(!m_Passthrough)
|
||||
{
|
||||
m_omx_mixer.DisablePort(m_omx_mixer.GetOutputPort(), false);
|
||||
@@ -965,6 +1116,11 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
}
|
||||
|
||||
m_pcm_output.nSamplingRate = m_format.m_sampleRate;
|
||||
+ // "Currently this component only supports raw PCM on all audio ports."
|
||||
+ if(m_omx_splitter.IsInitialized())
|
||||
+ {
|
||||
+ m_pcm_output.ePCMMode = OMX_AUDIO_PCMModeLinear;
|
||||
+ }
|
||||
|
||||
/* setup mixer output */
|
||||
m_pcm_output.nPortIndex = m_omx_mixer.GetOutputPort();
|
||||
@@ -981,16 +1137,64 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
|
||||
m_pcm_output.nSamplingRate = m_format.m_sampleRate;
|
||||
|
||||
- m_pcm_output.nPortIndex = m_omx_render->GetInputPort();
|
||||
- omx_err = m_omx_render->SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ if(m_omx_splitter.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::AddPackets error SetParameter 1 render omx_err(0x%08x)\n", omx_err);
|
||||
+ m_pcm_output.nPortIndex = m_omx_splitter.GetInputPort();
|
||||
+ omx_err = m_omx_splitter.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets error SetParameter 1 omx_err(0x%08x) for m_omx_splitter\n", omx_err);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ // Splitter will copy input params to output when input port is enabled.
|
||||
+ omx_err = m_omx_splitter.SetStateForComponent(OMX_StateIdle);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets - Error setting OMX_StateIdle 0x%08x for m_omx_splitter", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ m_omx_splitter.EnablePort(m_omx_splitter.GetInputPort(), false);
|
||||
+ m_omx_splitter.DisablePort(m_omx_splitter.GetInputPort(), false);
|
||||
+
|
||||
+ omx_err = m_omx_splitter.SetStateForComponent(OMX_StateExecuting);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets - Error setting OMX_StateExecuting 0x%08x for m_omx_splitter", omx_err);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ m_pcm_output.nPortIndex = m_omx_splitter.GetOutputPort();
|
||||
+ omx_err = m_omx_splitter.GetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets error GetParameter 3 omx_err(0x%08x) for m_omx_splitter\n", omx_err);
|
||||
+ }
|
||||
+
|
||||
+ m_pcm_output.nSamplingRate = m_format.m_sampleRate;
|
||||
}
|
||||
- omx_err = m_omx_render->GetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+
|
||||
+ if(m_omx_render_analog.IsInitialized())
|
||||
+ {
|
||||
+ m_pcm_output.nPortIndex = m_omx_render_analog.GetInputPort();
|
||||
+ omx_err = m_omx_render_analog.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets error SetParameter 1 render omx_err(0x%08x) for m_omx_render_analog\n", omx_err);
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ if(m_omx_render_HDMI.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "COMXAudio::AddPackets error GetParameter 2 render omx_err(0x%08x)\n", omx_err);
|
||||
+ m_pcm_output.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
+ omx_err = m_omx_render_HDMI.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output);
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "COMXAudio::AddPackets error SetParameter 1 render omx_err(0x%08x) for m_omx_render_HDMI\n", omx_err);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
PrintPCM(&m_pcm_input, std::string("input"));
|
||||
@@ -1000,9 +1204,9 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
{
|
||||
OMX_AUDIO_PARAM_PORTFORMATTYPE formatType;
|
||||
OMX_INIT_STRUCTURE(formatType);
|
||||
- formatType.nPortIndex = m_omx_render->GetInputPort();
|
||||
+ formatType.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
|
||||
- omx_err = m_omx_render->GetParameter(OMX_IndexParamAudioPortFormat, &formatType);
|
||||
+ omx_err = m_omx_render_HDMI.GetParameter(OMX_IndexParamAudioPortFormat, &formatType);
|
||||
if(omx_err != OMX_ErrorNone)
|
||||
{
|
||||
CLog::Log(LOGERROR, "COMXAudio::AddPackets error OMX_IndexParamAudioPortFormat omx_err(0x%08x)\n", omx_err);
|
||||
@@ -1011,7 +1215,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
|
||||
formatType.eEncoding = m_eEncoding;
|
||||
|
||||
- omx_err = m_omx_render->SetParameter(OMX_IndexParamAudioPortFormat, &formatType);
|
||||
+ omx_err = m_omx_render_HDMI.SetParameter(OMX_IndexParamAudioPortFormat, &formatType);
|
||||
if(omx_err != OMX_ErrorNone)
|
||||
{
|
||||
CLog::Log(LOGERROR, "COMXAudio::AddPackets error OMX_IndexParamAudioPortFormat omx_err(0x%08x)\n", omx_err);
|
||||
@@ -1023,7 +1227,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
OMX_AUDIO_PARAM_DDPTYPE m_ddParam;
|
||||
OMX_INIT_STRUCTURE(m_ddParam);
|
||||
|
||||
- m_ddParam.nPortIndex = m_omx_render->GetInputPort();
|
||||
+ m_ddParam.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
|
||||
m_ddParam.nChannels = m_format.m_channelLayout.Count(); //(m_InputChannels == 6) ? 8 : m_InputChannels;
|
||||
m_ddParam.nSampleRate = m_SampleRate;
|
||||
@@ -1038,13 +1242,13 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
m_ddParam.eChannelMapping[i] = OMXChannels[i];
|
||||
}
|
||||
|
||||
- m_omx_render->SetParameter(OMX_IndexParamAudioDdp, &m_ddParam);
|
||||
- m_omx_render->GetParameter(OMX_IndexParamAudioDdp, &m_ddParam);
|
||||
+ m_omx_render_HDMI.SetParameter(OMX_IndexParamAudioDdp, &m_ddParam);
|
||||
+ m_omx_render_HDMI.GetParameter(OMX_IndexParamAudioDdp, &m_ddParam);
|
||||
PrintDDP(&m_ddParam);
|
||||
}
|
||||
else if(m_eEncoding == OMX_AUDIO_CodingDTS)
|
||||
{
|
||||
- m_dtsParam.nPortIndex = m_omx_render->GetInputPort();
|
||||
+ m_dtsParam.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
|
||||
m_dtsParam.nChannels = m_format.m_channelLayout.Count(); //(m_InputChannels == 6) ? 8 : m_InputChannels;
|
||||
m_dtsParam.nBitRate = 0;
|
||||
@@ -1057,13 +1261,24 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
|
||||
m_dtsParam.eChannelMapping[i] = OMXChannels[i];
|
||||
}
|
||||
|
||||
- m_omx_render->SetParameter(OMX_IndexParamAudioDts, &m_dtsParam);
|
||||
- m_omx_render->GetParameter(OMX_IndexParamAudioDts, &m_dtsParam);
|
||||
+ m_omx_render_HDMI.SetParameter(OMX_IndexParamAudioDts, &m_dtsParam);
|
||||
+ m_omx_render_HDMI.GetParameter(OMX_IndexParamAudioDts, &m_dtsParam);
|
||||
PrintDTS(&m_dtsParam);
|
||||
}
|
||||
}
|
||||
|
||||
- m_omx_render->EnablePort(m_omx_render->GetInputPort(), false);
|
||||
+ if(m_omx_render_analog.IsInitialized())
|
||||
+ m_omx_render_analog.EnablePort(m_omx_render_analog.GetInputPort(), false);
|
||||
+ if(m_omx_render_HDMI.IsInitialized())
|
||||
+ m_omx_render_HDMI.EnablePort(m_omx_render_HDMI.GetInputPort(), false);
|
||||
+
|
||||
+ if(m_omx_splitter.IsInitialized())
|
||||
+ {
|
||||
+ m_omx_splitter.EnablePort(m_omx_splitter.GetOutputPort(), false);
|
||||
+ m_omx_splitter.EnablePort(m_omx_splitter.GetOutputPort()+1, false);
|
||||
+ m_omx_splitter.EnablePort(m_omx_splitter.GetInputPort(), false);
|
||||
+ }
|
||||
+
|
||||
if(!m_Passthrough)
|
||||
{
|
||||
m_omx_mixer.EnablePort(m_omx_mixer.GetOutputPort(), false);
|
||||
@@ -1139,21 +1354,49 @@ unsigned int COMXAudio::GetAudioRenderingLatency()
|
||||
if(!m_Initialized)
|
||||
return 0;
|
||||
|
||||
- OMX_PARAM_U32TYPE param;
|
||||
- OMX_INIT_STRUCTURE(param);
|
||||
- param.nPortIndex = m_omx_render->GetInputPort();
|
||||
+ unsigned int latAnalog = 0;
|
||||
+ unsigned int latHDMI = 0;
|
||||
|
||||
- OMX_ERRORTYPE omx_err =
|
||||
- m_omx_render->GetConfig(OMX_IndexConfigAudioRenderingLatency, ¶m);
|
||||
+ // Prefer HDMI latency if both are used
|
||||
+ if(m_omx_render_analog.IsInitialized() && !m_omx_render_HDMI.IsInitialized())
|
||||
+ {
|
||||
+ OMX_PARAM_U32TYPE param;
|
||||
+ OMX_INIT_STRUCTURE(param);
|
||||
+ param.nPortIndex = m_omx_render_analog.GetInputPort();
|
||||
|
||||
- if(omx_err != OMX_ErrorNone)
|
||||
+ OMX_ERRORTYPE omx_err =
|
||||
+ m_omx_render_analog.GetConfig(OMX_IndexConfigAudioRenderingLatency, ¶m);
|
||||
+
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "%s::%s - error getting OMX_IndexConfigAudioRenderingLatency error 0x%08x\n for m_omx_render_analog",
|
||||
+ CLASSNAME, __func__, omx_err);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ latAnalog = param.nU32;
|
||||
+ }
|
||||
+
|
||||
+ if(m_omx_render_HDMI.IsInitialized())
|
||||
{
|
||||
- CLog::Log(LOGERROR, "%s::%s - error getting OMX_IndexConfigAudioRenderingLatency error 0x%08x\n",
|
||||
- CLASSNAME, __func__, omx_err);
|
||||
- return 0;
|
||||
+ OMX_PARAM_U32TYPE param;
|
||||
+ OMX_INIT_STRUCTURE(param);
|
||||
+ param.nPortIndex = m_omx_render_HDMI.GetInputPort();
|
||||
+
|
||||
+ OMX_ERRORTYPE omx_err =
|
||||
+ m_omx_render_HDMI.GetConfig(OMX_IndexConfigAudioRenderingLatency, ¶m);
|
||||
+
|
||||
+ if(omx_err != OMX_ErrorNone)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "%s::%s - error getting OMX_IndexConfigAudioRenderingLatency error 0x%08x\n for m_omx_render_HDMI",
|
||||
+ CLASSNAME, __func__, omx_err);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ latHDMI = param.nU32;
|
||||
}
|
||||
|
||||
- return param.nU32;
|
||||
+ return std::max(latAnalog, latHDMI);
|
||||
}
|
||||
|
||||
void COMXAudio::WaitCompletion()
|
||||
@@ -1188,7 +1431,8 @@ void COMXAudio::WaitCompletion()
|
||||
unsigned int nTimeOut = AUDIO_BUFFER_SECONDS * 1000;
|
||||
while(nTimeOut)
|
||||
{
|
||||
- if(m_omx_render->IsEOS())
|
||||
+ if((m_omx_render_analog.IsInitialized() ? m_omx_render_analog.IsEOS() : true) &&
|
||||
+ (m_omx_render_HDMI.IsInitialized() ? m_omx_render_HDMI.IsEOS() : true))
|
||||
{
|
||||
CLog::Log(LOGDEBUG, "%s::%s - got eos\n", CLASSNAME, __func__);
|
||||
break;
|
||||
@@ -1218,7 +1462,8 @@ void COMXAudio::WaitCompletion()
|
||||
nTimeOut -= 50;
|
||||
}
|
||||
|
||||
- m_omx_render->ResetEos();
|
||||
+ m_omx_render_analog.ResetEos();
|
||||
+ m_omx_render_HDMI.ResetEos();
|
||||
|
||||
return;
|
||||
}
|
||||
diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h
|
||||
index d812e0a..81aeb7e 100644
|
||||
--- a/xbmc/cores/omxplayer/OMXAudio.h
|
||||
+++ b/xbmc/cores/omxplayer/OMXAudio.h
|
||||
@@ -60,7 +60,7 @@ class COMXAudio
|
||||
float GetCacheTime();
|
||||
float GetCacheTotal();
|
||||
COMXAudio();
|
||||
- bool Initialize(AEAudioFormat format, std::string& device, OMXClock *clock, CDVDStreamInfo &hints, bool bUsePassthrough, bool bUseHWDecode);
|
||||
+ bool Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo &hints, bool bUsePassthrough, bool bUseHWDecode);
|
||||
~COMXAudio();
|
||||
|
||||
unsigned int AddPackets(const void* data, unsigned int len);
|
||||
@@ -132,12 +132,18 @@ class COMXAudio
|
||||
WAVEFORMATEXTENSIBLE m_wave_header;
|
||||
AEAudioFormat m_format;
|
||||
protected:
|
||||
- COMXCoreComponent *m_omx_render;
|
||||
+ void DumpStates();
|
||||
+ COMXCoreComponent m_omx_render_analog;
|
||||
+ COMXCoreComponent m_omx_render_HDMI;
|
||||
+ COMXCoreComponent m_omx_splitter;
|
||||
COMXCoreComponent m_omx_mixer;
|
||||
COMXCoreComponent m_omx_decoder;
|
||||
- COMXCoreTunel m_omx_tunnel_clock;
|
||||
+ COMXCoreTunel m_omx_tunnel_clock_analog;
|
||||
+ COMXCoreTunel m_omx_tunnel_clock_HDMI;
|
||||
COMXCoreTunel m_omx_tunnel_mixer;
|
||||
COMXCoreTunel m_omx_tunnel_decoder;
|
||||
+ COMXCoreTunel m_omx_tunnel_splitter_analog;
|
||||
+ COMXCoreTunel m_omx_tunnel_splitter_HDMI;
|
||||
DllAvUtil m_dllAvUtil;
|
||||
|
||||
OMX_AUDIO_CHANNELTYPE m_input_channels[OMX_AUDIO_MAXCHANNELS];
|
||||
diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
|
||||
index 58c3a4f..f3276d2 100644
|
||||
--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
|
||||
+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
|
||||
@@ -731,17 +731,10 @@ bool OMXPlayerAudio::OpenDecoder()
|
||||
/* GetDataFormat is setting up evrything */
|
||||
m_format.m_dataFormat = GetDataFormat(m_hints);
|
||||
|
||||
- std::string device = "";
|
||||
-
|
||||
- if(g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI)
|
||||
- device = "hdmi";
|
||||
- else
|
||||
- device = "local";
|
||||
-
|
||||
m_av_clock->Lock();
|
||||
m_av_clock->OMXStop(false);
|
||||
|
||||
- bool bAudioRenderOpen = m_omxAudio.Initialize(m_format, device, m_av_clock, m_hints, m_passthrough, m_hw_decode);
|
||||
+ bool bAudioRenderOpen = m_omxAudio.Initialize(m_format, m_av_clock, m_hints, m_passthrough, m_hw_decode);
|
||||
|
||||
m_codec_name = "";
|
||||
m_bad_state = !bAudioRenderOpen;
|
||||
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
|
||||
index e92a82d..e798683 100644
|
||||
--- a/xbmc/settings/GUISettings.cpp
|
||||
+++ b/xbmc/settings/GUISettings.cpp
|
||||
@@ -457,6 +457,8 @@ void CGUISettings::Initialize()
|
||||
audiomode.insert(make_pair(338,AUDIO_ANALOG));
|
||||
#if !defined(TARGET_RASPBERRY_PI)
|
||||
audiomode.insert(make_pair(339,AUDIO_IEC958));
|
||||
+#else
|
||||
+ audiomode.insert(make_pair(593,AUDIO_BOTH));
|
||||
#endif
|
||||
audiomode.insert(make_pair(420,AUDIO_HDMI ));
|
||||
#if defined(TARGET_RASPBERRY_PI)
|
||||
diff --git a/xbmc/settings/GUISettings.h b/xbmc/settings/GUISettings.h
|
||||
index b48ba35..500ec36 100644
|
||||
--- a/xbmc/settings/GUISettings.h
|
||||
+++ b/xbmc/settings/GUISettings.h
|
||||
@@ -84,6 +84,9 @@
|
||||
#define AUDIO_ANALOG 0
|
||||
#define AUDIO_IEC958 1
|
||||
#define AUDIO_HDMI 2
|
||||
+#ifdef TARGET_RASPBERRY_PI
|
||||
+#define AUDIO_BOTH 3
|
||||
+#endif
|
||||
#define AUDIO_IS_BITSTREAM(x) ((x) == AUDIO_IEC958 || (x) == AUDIO_HDMI)
|
||||
|
||||
#define VIDEO_NORMAL 0
|
||||
--
|
||||
1.8.1.6
|
||||
|
||||
|
||||
From 85bb82a3f78a63385767e8e1a7490860077b1b32 Mon Sep 17 00:00:00 2001
|
||||
From: stupid-boy <amushatov@gmail.com>
|
||||
Date: Thu, 7 Mar 2013 20:46:21 +0200
|
||||
Subject: [PATCH 2/2] Seek fixed
|
||||
|
||||
---
|
||||
xbmc/cores/omxplayer/OMXAudio.cpp | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
index 1470685..6b0e71a 100644
|
||||
--- a/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
+++ b/xbmc/cores/omxplayer/OMXAudio.cpp
|
||||
@@ -749,8 +749,16 @@ void COMXAudio::Flush()
|
||||
|
||||
m_omx_decoder.FlushInput();
|
||||
m_omx_tunnel_decoder.Flush();
|
||||
- if(!m_Passthrough)
|
||||
+ if ( m_omx_mixer.IsInitialized() )
|
||||
+ m_omx_mixer.FlushAll();
|
||||
+ if( m_omx_tunnel_mixer.IsInitialized() )
|
||||
m_omx_tunnel_mixer.Flush();
|
||||
+ if ( m_omx_splitter.IsInitialized() )
|
||||
+ m_omx_splitter.FlushAll();
|
||||
+ if ( m_omx_tunnel_splitter_analog.IsInitialized() )
|
||||
+ m_omx_tunnel_splitter_analog.Flush();
|
||||
+ if ( m_omx_tunnel_splitter_HDMI.IsInitialized() )
|
||||
+ m_omx_tunnel_splitter_HDMI.Flush();
|
||||
|
||||
m_last_pts = DVD_NOPTS_VALUE;
|
||||
m_LostSync = true;
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,29 +0,0 @@
|
||||
From f3ffe4e25bfca41379e4e2ffba75ad55d13ba30e Mon Sep 17 00:00:00 2001
|
||||
From: xbmc <fernetmenta@online.de>
|
||||
Date: Thu, 21 Mar 2013 07:53:20 +0100
|
||||
Subject: [PATCH] only free unused textures after a flip
|
||||
|
||||
---
|
||||
xbmc/Application.cpp | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
|
||||
index fa0e71d..5bd2d72 100644
|
||||
--- a/xbmc/Application.cpp
|
||||
+++ b/xbmc/Application.cpp
|
||||
@@ -2363,11 +2363,10 @@ void CApplication::Render()
|
||||
{
|
||||
g_graphicsContext.Flip(dirtyRegions);
|
||||
g_renderManager.NotifyDisplayFlip();
|
||||
+ g_TextureManager.FreeUnusedTextures();
|
||||
}
|
||||
CTimeUtils::UpdateFrameTime(flip);
|
||||
|
||||
- g_TextureManager.FreeUnusedTextures();
|
||||
-
|
||||
g_renderManager.UpdateResolution();
|
||||
g_renderManager.ManageCaptures();
|
||||
}
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -1,55 +0,0 @@
|
||||
From 1704ff69ba704bf53505f7f9ac51ec06f93401ee Mon Sep 17 00:00:00 2001
|
||||
From: wsnipex <wsnipex@a1.net>
|
||||
Date: Sun, 9 Dec 2012 14:37:21 +0100
|
||||
Subject: [PATCH 1/2] configure: allow GIT_REV to be read from VERSION file
|
||||
needed for building outside of a git repo
|
||||
|
||||
---
|
||||
configure.in | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index d8c7804..ac1445c 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -2160,7 +2160,12 @@ if test "$HAVE_GIT" = "yes"; then
|
||||
GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
|
||||
fi
|
||||
if test "$GIT_REV" = ""; then
|
||||
- GIT_REV="Unknown"
|
||||
+ if test -f VERSION ; then
|
||||
+ GIT_REV=$(awk 'END{print substr($1,1,16)}' VERSION)
|
||||
+ if test -z $GIT_REV ; then GIT_REV="Unknown" ; fi
|
||||
+ else
|
||||
+ GIT_REV="Unknown"
|
||||
+ fi
|
||||
fi
|
||||
if test "$host_vendor" = "apple"; then
|
||||
echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
|
||||
--
|
||||
1.7.10
|
||||
|
||||
|
||||
From 4377a985c7e4e4d1f1c0abba68c2367d33ddab03 Mon Sep 17 00:00:00 2001
|
||||
From: wsnipex <wsnipex@a1.net>
|
||||
Date: Sun, 16 Dec 2012 17:46:12 +0100
|
||||
Subject: [PATCH 2/2] release-source script needs bash on some systems /bin/sh
|
||||
is a simplistic posix shell
|
||||
|
||||
---
|
||||
tools/mk-release-source | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/mk-release-source b/tools/mk-release-source
|
||||
index 7964665..68bdfa1 100755
|
||||
--- a/tools/mk-release-source
|
||||
+++ b/tools/mk-release-source
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
REVISION="${1}"
|
||||
COMPRESS="gzip"
|
||||
WORKDIR="xbmc-${REVISION}"
|
||||
--
|
||||
1.7.10
|
||||
|
@ -1,88 +0,0 @@
|
||||
From 1e3abea7b9a4212005b11dbb5a9542ca9cbcd21a Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Raue <stephan@openelec.tv>
|
||||
Date: Thu, 7 Feb 2013 18:27:08 +0100
|
||||
Subject: [PATCH] configure.in: change check for 'VERSION' file: - first check
|
||||
if this file exist and use the content from there - if it
|
||||
not exist check with 'git log' - if this fails set to
|
||||
'Unknown'
|
||||
|
||||
This patch also shows the GIT_REV in the configure summary message. To display This message on top of the messages we move the whole block a bit above
|
||||
---
|
||||
configure.in | 40 ++++++++++++++++++++--------------------
|
||||
1 file changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index ac1445c..869fd29 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -687,6 +687,25 @@ case $use_platform in
|
||||
;;
|
||||
esac
|
||||
|
||||
+# check for GIT_REV
|
||||
+AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
|
||||
+if test "$GIT_REV" = ""; then
|
||||
+ if test -f VERSION ; then
|
||||
+ GIT_REV=$(awk 'END{print substr($1,1,16)}' VERSION)
|
||||
+ elif test "$HAVE_GIT" = "yes"; then
|
||||
+ GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
|
||||
+ else
|
||||
+ GIT_REV="Unknown"
|
||||
+ fi
|
||||
+fi
|
||||
+final_message="$final_message\n git Rev.:\t${GIT_REV}"
|
||||
+
|
||||
+if test "$host_vendor" = "apple"; then
|
||||
+ echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
|
||||
+else
|
||||
+ SDL_DEFINES="$SDL_DEFINES -D'GIT_REV=\"$GIT_REV\"'"
|
||||
+fi
|
||||
+
|
||||
if test "$build_shared_lib" = "yes"; then
|
||||
final_message="$final_message\n Shared lib\tYes"
|
||||
AC_SUBST(USE_LIBXBMC,1)
|
||||
@@ -1886,8 +1905,6 @@ if test "$ARCH" = "i486-linux" || test "$ARCH" = "x86-freebsd"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
-AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)
|
||||
-
|
||||
# Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
@@ -1943,7 +1960,7 @@ else
|
||||
USE_OPENGL=1
|
||||
else
|
||||
final_message="$final_message\n OpenGL:\tNo (Very Slow)"
|
||||
- SDL_DEFINES="-DHAS_SDL_2D"
|
||||
+ SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_2D"
|
||||
USE_OPENGL=0
|
||||
fi
|
||||
fi
|
||||
@@ -2156,23 +2173,6 @@ else
|
||||
final_message="$final_message\n Avahi:\tNo"
|
||||
fi
|
||||
|
||||
-if test "$HAVE_GIT" = "yes"; then
|
||||
- GIT_REV=$(git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}')
|
||||
-fi
|
||||
-if test "$GIT_REV" = ""; then
|
||||
- if test -f VERSION ; then
|
||||
- GIT_REV=$(awk 'END{print substr($1,1,16)}' VERSION)
|
||||
- if test -z $GIT_REV ; then GIT_REV="Unknown" ; fi
|
||||
- else
|
||||
- GIT_REV="Unknown"
|
||||
- fi
|
||||
-fi
|
||||
-if test "$host_vendor" = "apple"; then
|
||||
- echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
|
||||
-else
|
||||
- SDL_DEFINES="$SDL_DEFINES -D'GIT_REV=\"$GIT_REV\"'"
|
||||
-fi
|
||||
-
|
||||
if test "$use_nonfree" = "yes"; then
|
||||
final_message="$final_message\n Non-free:\tYes"
|
||||
HAVE_XBMC_NONFREE=1
|
||||
--
|
||||
1.7.10
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 3180ec7e5e065c0f9276a2d8999e8e8d997c4dba Mon Sep 17 00:00:00 2001
|
||||
From: xbmc <fernetmenta@online.de>
|
||||
Date: Sat, 16 Mar 2013 15:52:55 +0100
|
||||
Subject: [PATCH] dvdplayer: put line break into video codec info because it
|
||||
gets too long
|
||||
|
||||
---
|
||||
xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
index be89406..bb1fc42 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
@@ -2579,7 +2579,7 @@ void CDVDPlayer::GetVideoInfo(CStdString& strVideoInfo)
|
||||
{ CSingleLock lock(m_StateSection);
|
||||
strVideoInfo.Format("D(%s)", m_StateInput.demux_video.c_str());
|
||||
}
|
||||
- strVideoInfo.AppendFormat(" P(%s)", m_dvdPlayerVideo.GetPlayerInfo().c_str());
|
||||
+ strVideoInfo.AppendFormat("\nP(%s)", m_dvdPlayerVideo.GetPlayerInfo().c_str());
|
||||
}
|
||||
|
||||
void CDVDPlayer::GetGeneralInfo(CStdString& strGeneralInfo)
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -1,138 +0,0 @@
|
||||
From 07b4e2c80c046bad566ed4a70e49ae4bfb3ecc47 Mon Sep 17 00:00:00 2001
|
||||
From: stupid-boy <amushatov@gmail.com>
|
||||
Date: Wed, 13 Feb 2013 20:56:12 +0200
|
||||
Subject: [PATCH] Changed cpu frequency for all Linux platforms, added RPI
|
||||
specific cpu temp command and removed irrelevant gpu temp
|
||||
for all ARM platforms.
|
||||
|
||||
---
|
||||
xbmc/utils/CPUInfo.cpp | 41 +++++++++++++++++-----------------
|
||||
xbmc/utils/CPUInfo.h | 2 +-
|
||||
xbmc/windows/GUIWindowSystemInfo.cpp | 4 +++-
|
||||
3 files changed, 24 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
|
||||
index 64c90b9..f605751 100644
|
||||
--- a/xbmc/utils/CPUInfo.cpp
|
||||
+++ b/xbmc/utils/CPUInfo.cpp
|
||||
@@ -107,7 +107,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
|
||||
|
||||
CCPUInfo::CCPUInfo(void)
|
||||
{
|
||||
- m_fProcStat = m_fProcTemperature = m_fCPUInfo = NULL;
|
||||
+ m_fProcStat = m_fProcTemperature = m_fCPUFreq = NULL;
|
||||
m_lastUsedPercentage = 0;
|
||||
m_cpuFeatures = 0;
|
||||
|
||||
@@ -235,15 +235,20 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
|
||||
// read from the new location of the temperature data on new kernels, 2.6.39, 3.0 etc
|
||||
if (m_fProcTemperature == NULL)
|
||||
m_fProcTemperature = fopen("/sys/class/hwmon/hwmon0/temp1_input", "r");
|
||||
-
|
||||
- m_fCPUInfo = fopen("/proc/cpuinfo", "r");
|
||||
+ if (m_fProcTemperature == NULL)
|
||||
+ m_fProcTemperature = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); // On Raspberry PIs
|
||||
+
|
||||
+ m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
|
||||
+
|
||||
+
|
||||
+ FILE* fCPUInfo = fopen("/proc/cpuinfo", "r");
|
||||
m_cpuCount = 0;
|
||||
- if (m_fCPUInfo)
|
||||
+ if (fCPUInfo)
|
||||
{
|
||||
char buffer[512];
|
||||
|
||||
int nCurrId = 0;
|
||||
- while (fgets(buffer, sizeof(buffer), m_fCPUInfo))
|
||||
+ while (fgets(buffer, sizeof(buffer), fCPUInfo))
|
||||
{
|
||||
if (strncmp(buffer, "processor", strlen("processor"))==0)
|
||||
{
|
||||
@@ -369,6 +374,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
|
||||
}
|
||||
}
|
||||
}
|
||||
+ fclose(fCPUInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -409,8 +415,8 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
|
||||
if (m_fProcTemperature != NULL)
|
||||
fclose(m_fProcTemperature);
|
||||
|
||||
- if (m_fCPUInfo != NULL)
|
||||
- fclose(m_fCPUInfo);
|
||||
+ if (m_fCPUFreq != NULL)
|
||||
+ fclose(m_fCPUFreq);
|
||||
}
|
||||
|
||||
int CCPUInfo::getUsedPercentage()
|
||||
@@ -482,21 +488,14 @@ float CCPUInfo::getCPUFrequency()
|
||||
hz = 0;
|
||||
return (float)hz;
|
||||
#else
|
||||
- float mhz = 0.f;
|
||||
- char buf[256],
|
||||
- *needle = NULL;
|
||||
- if (!m_fCPUInfo)
|
||||
- return mhz;
|
||||
- rewind(m_fCPUInfo);
|
||||
- fflush(m_fCPUInfo);
|
||||
- while (fgets(buf, 256, m_fCPUInfo) != NULL) {
|
||||
- if (strncmp(buf, "cpu MHz", 7) == 0) {
|
||||
- needle = strchr(buf, ':');
|
||||
- sscanf(++needle, "%f", &mhz);
|
||||
- break;
|
||||
- }
|
||||
+ int value = 0;
|
||||
+ if (m_fCPUFreq)
|
||||
+ {
|
||||
+ rewind(m_fCPUFreq);
|
||||
+ fflush(m_fCPUFreq);
|
||||
+ fscanf(m_fCPUFreq, "%d", &value);
|
||||
}
|
||||
- return mhz;
|
||||
+ return value / 1000.0;
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/xbmc/utils/CPUInfo.h b/xbmc/utils/CPUInfo.h
|
||||
index 638c19f..ae9447d 100644
|
||||
--- a/xbmc/utils/CPUInfo.h
|
||||
+++ b/xbmc/utils/CPUInfo.h
|
||||
@@ -93,7 +93,7 @@ class CCPUInfo
|
||||
|
||||
FILE* m_fProcStat;
|
||||
FILE* m_fProcTemperature;
|
||||
- FILE* m_fCPUInfo;
|
||||
+ FILE* m_fCPUFreq;
|
||||
|
||||
unsigned long long m_userTicks;
|
||||
unsigned long long m_niceTicks;
|
||||
diff --git a/xbmc/windows/GUIWindowSystemInfo.cpp b/xbmc/windows/GUIWindowSystemInfo.cpp
|
||||
index fcc1f89..75fd0cd 100644
|
||||
--- a/xbmc/windows/GUIWindowSystemInfo.cpp
|
||||
+++ b/xbmc/windows/GUIWindowSystemInfo.cpp
|
||||
@@ -141,7 +141,9 @@ void CGUIWindowSystemInfo::FrameMove()
|
||||
SetControlLabel(i++, "%s %s", 22023, SYSTEM_RENDER_VENDOR);
|
||||
SetControlLabel(i++, "%s %s", 22024, SYSTEM_RENDER_VERSION);
|
||||
#endif
|
||||
+#ifndef __arm__
|
||||
SetControlLabel(i++, "%s %s", 22010, SYSTEM_GPU_TEMPERATURE);
|
||||
+#endif
|
||||
}
|
||||
else if (m_section == CONTROL_BT_HARDWARE)
|
||||
{
|
||||
@@ -155,7 +157,7 @@ void CGUIWindowSystemInfo::FrameMove()
|
||||
SET_CONTROL_LABEL(i++, g_sysinfo.GetCPUSerial());
|
||||
#endif
|
||||
SetControlLabel(i++, "%s %s", 22011, SYSTEM_CPU_TEMPERATURE);
|
||||
-#if !defined(__arm__)
|
||||
+#if !defined(__arm__) || defined(TARGET_RASPBERRY_PI)
|
||||
SetControlLabel(i++, "%s %s", 13284, SYSTEM_CPUFREQUENCY);
|
||||
#endif
|
||||
#endif
|
||||
--
|
||||
1.7.10
|
||||
|
@ -1,94 +0,0 @@
|
||||
diff -Naur xbmc-12.0.6/xbmc/powermanagement/linux/FallbackPowerSyscall.h xbmc-12.0.6.patch/xbmc/powermanagement/linux/FallbackPowerSyscall.h
|
||||
--- xbmc-12.0.6/xbmc/powermanagement/linux/FallbackPowerSyscall.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ xbmc-12.0.6.patch/xbmc/powermanagement/linux/FallbackPowerSyscall.h 2013-03-13 22:25:29.220700789 +0100
|
||||
@@ -0,0 +1,39 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2005-2013 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, see
|
||||
+ * <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ */
|
||||
+#pragma once
|
||||
+#include "powermanagement/IPowerSyscall.h"
|
||||
+#include "system.h"
|
||||
+#if defined(TARGET_LINUX)
|
||||
+
|
||||
+class CFallbackPowerSyscall : public CPowerSyscallWithoutEvents
|
||||
+{
|
||||
+public:
|
||||
+ virtual bool Powerdown() {return true; }
|
||||
+ virtual bool Suspend() {return false; }
|
||||
+ virtual bool Hibernate() {return false; }
|
||||
+ virtual bool Reboot() {return true; }
|
||||
+
|
||||
+ virtual bool CanPowerdown() {return true; }
|
||||
+ virtual bool CanSuspend() {return false; }
|
||||
+ virtual bool CanHibernate() {return false; }
|
||||
+ virtual bool CanReboot() {return true; }
|
||||
+ virtual int BatteryLevel() {return 0; }
|
||||
+};
|
||||
+#endif
|
||||
diff -Naur xbmc-12.0.6/xbmc/powermanagement/PowerManager.cpp xbmc-12.0.6.patch/xbmc/powermanagement/PowerManager.cpp
|
||||
--- xbmc-12.0.6/xbmc/powermanagement/PowerManager.cpp 2013-03-11 18:01:45.000000000 +0100
|
||||
+++ xbmc-12.0.6.patch/xbmc/powermanagement/PowerManager.cpp 2013-03-14 00:20:43.263315592 +0100
|
||||
@@ -41,14 +41,17 @@
|
||||
#include "osx/CocoaPowerSyscall.h"
|
||||
#elif defined(TARGET_ANDROID)
|
||||
#include "android/AndroidPowerSyscall.h"
|
||||
-#elif defined(_LINUX) && defined(HAS_DBUS)
|
||||
+#elif defined(TARGET_LINUX)
|
||||
+#include "linux/FallbackPowerSyscall.h"
|
||||
+#if defined(HAS_DBUS)
|
||||
#include "linux/ConsoleUPowerSyscall.h"
|
||||
#include "linux/ConsoleDeviceKitPowerSyscall.h"
|
||||
#include "linux/SystemdUPowerSyscall.h"
|
||||
#include "linux/UPowerSyscall.h"
|
||||
-#ifdef HAS_HAL
|
||||
+#if defined(HAS_HAL)
|
||||
#include "linux/HALPowerSyscall.h"
|
||||
-#endif
|
||||
+#endif // HAS_HAL
|
||||
+#endif // HAS_DBUS
|
||||
#elif defined(_WIN32)
|
||||
#include "powermanagement/windows/Win32PowerSyscall.h"
|
||||
extern HWND g_hWnd;
|
||||
@@ -74,7 +77,8 @@
|
||||
m_instance = new CCocoaPowerSyscall();
|
||||
#elif defined(TARGET_ANDROID)
|
||||
m_instance = new CAndroidPowerSyscall();
|
||||
-#elif defined(_LINUX) && defined(HAS_DBUS)
|
||||
+#elif defined(TARGET_LINUX)
|
||||
+#if defined(HAS_DBUS)
|
||||
if (CConsoleUPowerSyscall::HasConsoleKitAndUPower())
|
||||
m_instance = new CConsoleUPowerSyscall();
|
||||
else if (CConsoleDeviceKitPowerSyscall::HasDeviceConsoleKit())
|
||||
@@ -83,10 +87,13 @@
|
||||
m_instance = new CSystemdUPowerSyscall();
|
||||
else if (CUPowerSyscall::HasUPower())
|
||||
m_instance = new CUPowerSyscall();
|
||||
-#ifdef HAS_HAL
|
||||
- else
|
||||
+#if defined(HAS_HAL)
|
||||
+ else if(1)
|
||||
m_instance = new CHALPowerSyscall();
|
||||
-#endif
|
||||
+#endif // HAS_HAL
|
||||
+#endif // HAS_DBUS
|
||||
+ else
|
||||
+ m_instance = new CFallbackPowerSyscall();
|
||||
#elif defined(_WIN32)
|
||||
m_instance = new CWin32PowerSyscall();
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
commit d1fcd3007827ddd2ab20864677a5baf64e4782a4
|
||||
Author: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Mon Jan 21 17:11:21 2013 +0200
|
||||
|
||||
add builtin to set GUI Language
|
||||
|
||||
diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp
|
||||
index fae2524..3f5ceab 100644
|
||||
--- a/xbmc/interfaces/Builtins.cpp
|
||||
+++ b/xbmc/interfaces/Builtins.cpp
|
||||
@@ -120,6 +120,7 @@ const BUILT_IN commands[] = {
|
||||
{ "Minimize", false, "Minimize XBMC" },
|
||||
{ "Reset", false, "Reset the system (same as reboot)" },
|
||||
{ "Mastermode", false, "Control master mode" },
|
||||
+ { "SetGUILanguage", true, "Set GUI Language" },
|
||||
{ "ActivateWindow", true, "Activate the specified window" },
|
||||
{ "ActivateWindowAndFocus", true, "Activate the specified window and sets focus to the specified id" },
|
||||
{ "ReplaceWindow", true, "Replaces the current window with the new one" },
|
||||
@@ -321,6 +322,13 @@ int CBuiltins::Execute(const CStdString& execString)
|
||||
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE);
|
||||
g_windowManager.SendMessage(msg);
|
||||
}
|
||||
+ else if (execute.Equals("setguilanguage"))
|
||||
+ {
|
||||
+ if (params.size())
|
||||
+ {
|
||||
+ CApplicationMessenger::Get().SetGUILanguage(params[0]);
|
||||
+ }
|
||||
+ }
|
||||
else if (execute.Equals("takescreenshot"))
|
||||
{
|
||||
CScreenShot::TakeScreenshot();
|
@ -1,184 +0,0 @@
|
||||
From 2da77839fbf972e8c6f09c56d25f8c7bf999f3fa Mon Sep 17 00:00:00 2001
|
||||
From: dezi <dezi@kappa-mm.de>
|
||||
Date: Mon, 18 Mar 2013 12:29:27 +0000
|
||||
Subject: [PATCH] Added hotplug support for Linux input devices.
|
||||
|
||||
---
|
||||
xbmc/input/linux/LinuxInputDevices.cpp | 80 ++++++++++++++++++++++++++++++++++
|
||||
xbmc/input/linux/LinuxInputDevices.h | 6 +++
|
||||
2 files changed, 86 insertions(+)
|
||||
|
||||
diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp
|
||||
index 9d253bb..1d3d315 100644
|
||||
--- a/xbmc/input/linux/LinuxInputDevices.cpp
|
||||
+++ b/xbmc/input/linux/LinuxInputDevices.cpp
|
||||
@@ -338,6 +338,7 @@
|
||||
m_deviceMinKeyCode = 0;
|
||||
m_deviceMaxKeyCode = 0;
|
||||
m_deviceMaxAxis = 0;
|
||||
+ m_bUnplugged = false;
|
||||
|
||||
Open();
|
||||
}
|
||||
@@ -744,7 +745,15 @@ XBMC_Event CLinuxInputDevice::ReadEvent()
|
||||
readlen = read(m_fd, &levt, sizeof(levt));
|
||||
|
||||
if (readlen <= 0)
|
||||
+ {
|
||||
+ if (errno == ENODEV)
|
||||
+ {
|
||||
+ CLog::Log(LOGINFO,"input device was unplugged %s",m_deviceName);
|
||||
+ m_bUnplugged = true;
|
||||
+ }
|
||||
+
|
||||
break;
|
||||
+ }
|
||||
|
||||
//printf("read event readlen = %d device name %s m_fileName %s\n", readlen, m_deviceName, m_fileName.c_str());
|
||||
|
||||
@@ -963,6 +972,16 @@ void CLinuxInputDevice::GetInfo(int fd)
|
||||
//printf("pref: %d\n", m_devicePreferredId);
|
||||
}
|
||||
|
||||
+char* CLinuxInputDevice::GetDeviceName()
|
||||
+{
|
||||
+ return m_deviceName;
|
||||
+}
|
||||
+
|
||||
+bool CLinuxInputDevice::IsUnplugged()
|
||||
+{
|
||||
+ return m_bUnplugged;
|
||||
+}
|
||||
+
|
||||
bool CLinuxInputDevices::CheckDevice(const char *device)
|
||||
{
|
||||
int fd;
|
||||
@@ -1021,6 +1040,41 @@ void CLinuxInputDevices::InitAvailable()
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Check for hot plugged devices.
|
||||
+ */
|
||||
+void CLinuxInputDevices::CheckHotplugged()
|
||||
+{
|
||||
+ CSingleLock lock(m_devicesListLock);
|
||||
+
|
||||
+ int deviceId = m_devices.size();
|
||||
+
|
||||
+ /* No devices specified. Try to guess some. */
|
||||
+ for (int i = 0; i < MAX_LINUX_INPUT_DEVICES; i++)
|
||||
+ {
|
||||
+ char buf[32];
|
||||
+ bool ispresent = false;
|
||||
+
|
||||
+ snprintf(buf, 32, "/dev/input/event%d", i);
|
||||
+
|
||||
+ for (size_t j = 0; j < m_devices.size(); j++)
|
||||
+ {
|
||||
+ if (strcmp(m_devices[j]->GetDeviceName(),buf) == 0)
|
||||
+ {
|
||||
+ ispresent = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!ispresent && CheckDevice(buf))
|
||||
+ {
|
||||
+ CLog::Log(LOGINFO, "Found input device %s", buf);
|
||||
+ m_devices.push_back(new CLinuxInputDevice(buf, deviceId));
|
||||
+ ++deviceId;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Open the device, fill out information about it,
|
||||
* allocate and fill private data, start input thread.
|
||||
*/
|
||||
@@ -1076,6 +1130,9 @@ bool CLinuxInputDevice::Open()
|
||||
{
|
||||
if (m_vt_fd < 0)
|
||||
m_vt_fd = open("/dev/tty0", O_RDWR | O_NOCTTY);
|
||||
+
|
||||
+ if (m_vt_fd < 0)
|
||||
+ m_vt_fd = open("/dev/tty1", O_RDWR | O_NOCTTY);
|
||||
|
||||
if (m_vt_fd < 0)
|
||||
CLog::Log(LOGWARNING, "no keymap support (requires /dev/tty0 - CONFIG_VT)");
|
||||
@@ -1195,6 +1252,23 @@ void CLinuxInputDevice::Close()
|
||||
|
||||
XBMC_Event CLinuxInputDevices::ReadEvent()
|
||||
{
|
||||
+ if (m_bReInitialize)
|
||||
+ {
|
||||
+ InitAvailable();
|
||||
+ m_bReInitialize = false;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ time_t now;
|
||||
+ time(&now);
|
||||
+
|
||||
+ if ((now - m_lastHotplugCheck) >= 10)
|
||||
+ {
|
||||
+ CheckHotplugged();
|
||||
+ m_lastHotplugCheck = now;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
CSingleLock lock(m_devicesListLock);
|
||||
|
||||
XBMC_Event event;
|
||||
@@ -1207,6 +1281,12 @@ XBMC_Event CLinuxInputDevices::ReadEvent()
|
||||
{
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ if (m_devices[i]->IsUnplugged())
|
||||
+ {
|
||||
+ m_bReInitialize = true;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
return event;
|
||||
diff --git a/xbmc/input/linux/LinuxInputDevices.h b/xbmc/input/linux/LinuxInputDevices.h
|
||||
index 18224a9..b7626f4 100644
|
||||
--- a/xbmc/input/linux/LinuxInputDevices.h
|
||||
+++ b/xbmc/input/linux/LinuxInputDevices.h
|
||||
@@ -41,6 +41,8 @@ class CLinuxInputDevice
|
||||
CLinuxInputDevice(const std::string fileName, int index);
|
||||
~CLinuxInputDevice();
|
||||
XBMC_Event ReadEvent();
|
||||
+ char* GetDeviceName();
|
||||
+ bool IsUnplugged();
|
||||
|
||||
private:
|
||||
void SetupKeyboardAutoRepeat(int fd);
|
||||
@@ -76,12 +78,14 @@ class CLinuxInputDevice
|
||||
int m_deviceMaxKeyCode;
|
||||
int m_deviceMaxAxis;
|
||||
bool m_bSkipNonKeyEvents;
|
||||
+ bool m_bUnplugged;
|
||||
};
|
||||
|
||||
class CLinuxInputDevices
|
||||
{
|
||||
public:
|
||||
void InitAvailable();
|
||||
+ void CheckHotplugged();
|
||||
XBMC_Event ReadEvent();
|
||||
bool IsRemoteLowBattery();
|
||||
bool IsRemoteNotPaired();
|
||||
@@ -89,6 +93,8 @@ class CLinuxInputDevices
|
||||
CCriticalSection m_devicesListLock;
|
||||
bool CheckDevice(const char *device);
|
||||
std::vector<CLinuxInputDevice*> m_devices;
|
||||
+ bool m_bReInitialize;
|
||||
+ time_t m_lastHotplugCheck;
|
||||
};
|
||||
|
||||
#endif /* LINUXINPUTDEVICES_H_ */
|
||||
--
|
||||
1.8.1.5
|
||||
|
@ -1,60 +0,0 @@
|
||||
From d4c34400b9bdebbb1a943603a54fdf207034ddd1 Mon Sep 17 00:00:00 2001
|
||||
From: Dag Wieers <dag@wieers.com>
|
||||
Date: Sat, 20 Apr 2013 02:59:47 +0200
|
||||
Subject: [PATCH] Increase USB and CEC rescan interval to 5 seconds
|
||||
|
||||
In one of my investigations to see why XBMC performance is so bad (even when idle) I found one of the threads (in my case PeripheralBusCEC) scan a big sysfs tree recursively. On the 1Ghz AppleTV 1 device this would be about 2% of the CPU *every* second. For the USB thread we luckily have Udev events, but for CEC it is using sysfs polling which is quite expensive. It would be better to make use of Udev as well for CEC (where available) however 5 seconds should be fine for everyone.
|
||||
|
||||
In my own builds I even brought it down to 30 seconds. Which means 29 seconds of reduced CPU usage.
|
||||
|
||||
The CEC polling probably should be more restricted to specific sysfs sections, or preferably use Udev as well, when available.
|
||||
|
||||
PS XBMC needs a special idle-state where it can turn down these expensive threads to make sure hardware can go into deeper sleep states. Especially for devices that doesn't do suspend for various reasons this is a requirement. (The ATV1 device for instance gets warm even when idle) If we can combine display-sleep with low-power states and a less expensive main-loop, that would be already quite an improvement without needing a complete refactoring of the code.
|
||||
---
|
||||
xbmc/peripherals/bus/PeripheralBus.cpp | 2 +-
|
||||
xbmc/peripherals/bus/PeripheralBus.h | 2 +-
|
||||
xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/xbmc/peripherals/bus/PeripheralBus.cpp b/xbmc/peripherals/bus/PeripheralBus.cpp
|
||||
index 0e673ee..f0219f1 100644
|
||||
--- a/xbmc/peripherals/bus/PeripheralBus.cpp
|
||||
+++ b/xbmc/peripherals/bus/PeripheralBus.cpp
|
||||
@@ -27,7 +27,7 @@
|
||||
using namespace std;
|
||||
using namespace PERIPHERALS;
|
||||
|
||||
-#define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 1000
|
||||
+#define PERIPHERAL_DEFAULT_RESCAN_INTERVAL 5000
|
||||
|
||||
CPeripheralBus::CPeripheralBus(CPeripherals *manager, PeripheralBusType type) :
|
||||
CThread("PeripheralBus"),
|
||||
diff --git a/xbmc/peripherals/bus/PeripheralBus.h b/xbmc/peripherals/bus/PeripheralBus.h
|
||||
index cc368ac..24e1524 100644
|
||||
--- a/xbmc/peripherals/bus/PeripheralBus.h
|
||||
+++ b/xbmc/peripherals/bus/PeripheralBus.h
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/*!
|
||||
* @class CPeripheralBus
|
||||
- * This represents a bus on the system. By default, this bus instance will scan for changes every second.
|
||||
+ * This represents a bus on the system. By default, this bus instance will scan for changes every 5 seconds.
|
||||
* If this bus only has to be updated after a notification sent by the system, set m_bNeedsPolling to false
|
||||
* in the constructor, and implement the OnDeviceAdded(), OnDeviceChanged() and OnDeviceRemoved() methods.
|
||||
*
|
||||
diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
|
||||
index da169c1..0db7423 100644
|
||||
--- a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
|
||||
+++ b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
|
||||
@@ -57,7 +57,7 @@ class PERIPHERALS::DllLibCEC : public DllDynamic, DllLibCECInterface
|
||||
m_dll(new DllLibCEC),
|
||||
m_cecAdapter(NULL)
|
||||
{
|
||||
- m_iRescanTime = 1000;
|
||||
+ m_iRescanTime = 5000;
|
||||
if (!m_dll->Load() || !m_dll->IsLoaded())
|
||||
{
|
||||
delete m_dll;
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 7ee7e59e858c7f1901c6879e39b30480c42ef126 Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Mon, 29 Apr 2013 22:50:08 +0100
|
||||
Subject: [PATCH] [rbp] Remove unnecessary gl ifdef
|
||||
|
||||
I'm not sure why this was originally added.
|
||||
I couldn't think of a reason why the Pi would want things done differently here,
|
||||
so I tried without the ifdef. I can't see any difference in behaviour,
|
||||
so I think we're better off removing it.
|
||||
---
|
||||
xbmc/rendering/gles/RenderSystemGLES.cpp | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp
|
||||
index e7795fb..472f441 100644
|
||||
--- a/xbmc/rendering/gles/RenderSystemGLES.cpp
|
||||
+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp
|
||||
@@ -138,11 +138,7 @@ bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen
|
||||
g_matrices.MatrixMode(MM_PROJECTION);
|
||||
g_matrices.LoadIdentity();
|
||||
|
||||
-#ifdef TARGET_RASPBERRY_PI
|
||||
- g_matrices.Ortho(0.0f, width-1, height-1, 0.0f, +1.0f, 1.0f);
|
||||
-#else
|
||||
g_matrices.Ortho(0.0f, width-1, height-1, 0.0f, -1.0f, 1.0f);
|
||||
-#endif
|
||||
|
||||
g_matrices.MatrixMode(MM_MODELVIEW);
|
||||
g_matrices.LoadIdentity();
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,331 +0,0 @@
|
||||
From 1c12a2f021cceee0d7eee2de5df993d73d790aa5 Mon Sep 17 00:00:00 2001
|
||||
From: Cory Fields <theuni-nospam-@xbmc.org>
|
||||
Date: Thu, 9 May 2013 19:27:14 -0400
|
||||
Subject: [PATCH 1/2] texture: combine Load() and GetTexture() since they must
|
||||
be used together
|
||||
|
||||
---
|
||||
xbmc/guilib/GUITexture.cpp | 19 ++++++++--------
|
||||
xbmc/guilib/TextureManager.cpp | 51 ++++++++++++++++++++----------------------
|
||||
xbmc/guilib/TextureManager.h | 3 +--
|
||||
3 files changed, 34 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/xbmc/guilib/GUITexture.cpp b/xbmc/guilib/GUITexture.cpp
|
||||
index 9da2030..5896606 100644
|
||||
--- a/xbmc/guilib/GUITexture.cpp
|
||||
+++ b/xbmc/guilib/GUITexture.cpp
|
||||
@@ -301,11 +301,12 @@ bool CGUITextureBase::AllocResources()
|
||||
{ // we want to use the large image loader, but we first check for bundled textures
|
||||
if (!IsAllocated())
|
||||
{
|
||||
- int images = g_TextureManager.Load(m_info.filename, true);
|
||||
- if (images)
|
||||
+ CTextureArray texture;
|
||||
+ texture = g_TextureManager.Load(m_info.filename, true);
|
||||
+ if (texture.size())
|
||||
{
|
||||
m_isAllocated = NORMAL;
|
||||
- m_texture = g_TextureManager.GetTexture(m_info.filename);
|
||||
+ m_texture = texture;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
@@ -329,15 +330,14 @@ bool CGUITextureBase::AllocResources()
|
||||
}
|
||||
else if (!IsAllocated())
|
||||
{
|
||||
- int images = g_TextureManager.Load(m_info.filename);
|
||||
+ CTextureArray texture = g_TextureManager.Load(m_info.filename);
|
||||
|
||||
// set allocated to true even if we couldn't load the image to save
|
||||
// us hitting the disk every frame
|
||||
- m_isAllocated = images ? NORMAL : NORMAL_FAILED;
|
||||
- if (!images)
|
||||
+ m_isAllocated = texture.size() ? NORMAL : NORMAL_FAILED;
|
||||
+ if (!texture.size())
|
||||
return false;
|
||||
-
|
||||
- m_texture = g_TextureManager.GetTexture(m_info.filename);
|
||||
+ m_texture = texture;
|
||||
changed = true;
|
||||
}
|
||||
m_frameWidth = (float)m_texture.m_width;
|
||||
@@ -346,8 +346,7 @@ bool CGUITextureBase::AllocResources()
|
||||
// load the diffuse texture (if necessary)
|
||||
if (!m_info.diffuse.IsEmpty())
|
||||
{
|
||||
- g_TextureManager.Load(m_info.diffuse);
|
||||
- m_diffuse = g_TextureManager.GetTexture(m_info.diffuse);
|
||||
+ m_diffuse = g_TextureManager.Load(m_info.diffuse);
|
||||
}
|
||||
|
||||
CalculateSize();
|
||||
diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp
|
||||
index 93fdcd1..6d6c4d9 100644
|
||||
--- a/xbmc/guilib/TextureManager.cpp
|
||||
+++ b/xbmc/guilib/TextureManager.cpp
|
||||
@@ -221,22 +221,6 @@ void CTextureMap::Add(CBaseTexture* texture, int delay)
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
-const CTextureArray& CGUITextureManager::GetTexture(const CStdString& strTextureName)
|
||||
-{
|
||||
- static CTextureArray emptyTexture;
|
||||
- // CLog::Log(LOGINFO, " refcount++ for GetTexture(%s)\n", strTextureName.c_str());
|
||||
- for (int i = 0; i < (int)m_vecTextures.size(); ++i)
|
||||
- {
|
||||
- CTextureMap *pMap = m_vecTextures[i];
|
||||
- if (pMap->GetName() == strTextureName)
|
||||
- {
|
||||
- //CLog::Log(LOGDEBUG, "Total memusage %u", GetMemoryUsage());
|
||||
- return pMap->GetTexture();
|
||||
- }
|
||||
- }
|
||||
- return emptyTexture;
|
||||
-}
|
||||
-
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/************************************************************************/
|
||||
@@ -290,19 +274,32 @@ bool CGUITextureManager::HasTexture(const CStdString &textureName, CStdString *p
|
||||
return !fullPath.IsEmpty();
|
||||
}
|
||||
|
||||
-int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleOnly /*= false */)
|
||||
+const CTextureArray& CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleOnly /*= false */)
|
||||
{
|
||||
CStdString strPath;
|
||||
+ static CTextureArray emptyTexture;
|
||||
int bundle = -1;
|
||||
int size = 0;
|
||||
if (!HasTexture(strTextureName, &strPath, &bundle, &size))
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
|
||||
if (size) // we found the texture
|
||||
- return size;
|
||||
+ {
|
||||
+ for (int i = 0; i < (int)m_vecTextures.size(); ++i)
|
||||
+ {
|
||||
+ CTextureMap *pMap = m_vecTextures[i];
|
||||
+ if (pMap->GetName() == strTextureName)
|
||||
+ {
|
||||
+ //CLog::Log(LOGDEBUG, "Total memusage %u", GetMemoryUsage());
|
||||
+ return pMap->GetTexture();
|
||||
+ }
|
||||
+ }
|
||||
+ // Whoops, not there.
|
||||
+ return emptyTexture;
|
||||
+ }
|
||||
|
||||
if (checkBundleOnly && bundle == -1)
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
|
||||
//Lock here, we will do stuff that could break rendering
|
||||
CSingleLock lock(g_graphicsContext);
|
||||
@@ -327,7 +324,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO
|
||||
CLog::Log(LOGERROR, "Texture manager unable to load bundled file: %s", strTextureName.c_str());
|
||||
delete [] pTextures;
|
||||
delete [] Delay;
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
}
|
||||
|
||||
pMap = new CTextureMap(strTextureName, width, height, nLoops);
|
||||
@@ -348,7 +345,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO
|
||||
CStdString rootPath = strPath.Left(g_SkinInfo->Path().GetLength());
|
||||
if (0 == rootPath.CompareNoCase(g_SkinInfo->Path()))
|
||||
CLog::Log(LOGERROR, "Texture manager unable to load file: %s", strPath.c_str());
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
}
|
||||
int iWidth = AnimatedGifSet.FrameWidth;
|
||||
int iHeight = AnimatedGifSet.FrameHeight;
|
||||
@@ -386,7 +383,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO
|
||||
#endif
|
||||
|
||||
m_vecTextures.push_back(pMap);
|
||||
- return 1;
|
||||
+ return pMap->GetTexture();
|
||||
} // of if (strPath.Right(4).ToLower()==".gif")
|
||||
|
||||
CBaseTexture *pTexture = NULL;
|
||||
@@ -396,19 +393,19 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO
|
||||
if (!m_TexBundle[bundle].LoadTexture(strTextureName, &pTexture, width, height))
|
||||
{
|
||||
CLog::Log(LOGERROR, "Texture manager unable to load bundled file: %s", strTextureName.c_str());
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pTexture = CBaseTexture::LoadFromFile(strPath);
|
||||
if (!pTexture)
|
||||
- return 0;
|
||||
+ return emptyTexture;
|
||||
width = pTexture->GetWidth();
|
||||
height = pTexture->GetHeight();
|
||||
}
|
||||
|
||||
- if (!pTexture) return 0;
|
||||
+ if (!pTexture) return emptyTexture;
|
||||
|
||||
CTextureMap* pMap = new CTextureMap(strTextureName, width, height, 0);
|
||||
pMap->Add(pTexture, 100);
|
||||
@@ -423,7 +420,7 @@ int CGUITextureManager::Load(const CStdString& strTextureName, bool checkBundleO
|
||||
OutputDebugString(temp);
|
||||
#endif
|
||||
|
||||
- return 1;
|
||||
+ return pMap->GetTexture();
|
||||
}
|
||||
|
||||
|
||||
diff --git a/xbmc/guilib/TextureManager.h b/xbmc/guilib/TextureManager.h
|
||||
index c982e6a..22fc192 100644
|
||||
--- a/xbmc/guilib/TextureManager.h
|
||||
+++ b/xbmc/guilib/TextureManager.h
|
||||
@@ -108,8 +108,7 @@ class CGUITextureManager
|
||||
|
||||
bool HasTexture(const CStdString &textureName, CStdString *path = NULL, int *bundle = NULL, int *size = NULL);
|
||||
bool CanLoad(const CStdString &texturePath) const; ///< Returns true if the texture manager can load this texture
|
||||
- int Load(const CStdString& strTextureName, bool checkBundleOnly = false);
|
||||
- const CTextureArray& GetTexture(const CStdString& strTextureName);
|
||||
+ const CTextureArray& Load(const CStdString& strTextureName, bool checkBundleOnly = false);
|
||||
void ReleaseTexture(const CStdString& strTextureName);
|
||||
void Cleanup();
|
||||
void Dump() const;
|
||||
--
|
||||
1.8.1.6
|
||||
|
||||
|
||||
From ece7ac520231ff144d7bc4d8393d1ca36f227927 Mon Sep 17 00:00:00 2001
|
||||
From: Cory Fields <theuni-nospam-@xbmc.org>
|
||||
Date: Tue, 30 Apr 2013 23:01:57 -0400
|
||||
Subject: [PATCH 2/2] texture: two texture speedups
|
||||
|
||||
1. Check to see if we have a texture loaded already before opening/uploading
|
||||
another instance of it.
|
||||
|
||||
2. Set a time-out for deleting textures. If they are needed again before the
|
||||
time-out expires, they are re-added to the loaded textures array and ready
|
||||
for use again. Otherwise, they are deleted after X msec. This helps to avoid
|
||||
doing _really_ nasty things, like re-loading the background image when
|
||||
moving from home to settings.
|
||||
---
|
||||
xbmc/Application.cpp | 2 +-
|
||||
xbmc/guilib/TextureManager.cpp | 30 +++++++++++++++++++++++++-----
|
||||
xbmc/guilib/TextureManager.h | 6 ++++--
|
||||
3 files changed, 30 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
|
||||
index 37d17e3..df456ec 100644
|
||||
--- a/xbmc/Application.cpp
|
||||
+++ b/xbmc/Application.cpp
|
||||
@@ -4953,7 +4953,7 @@ void CApplication::ProcessSlow()
|
||||
if (!IsPlayingVideo())
|
||||
g_largeTextureManager.CleanupUnusedImages();
|
||||
|
||||
- g_TextureManager.FreeUnusedTextures();
|
||||
+ g_TextureManager.FreeUnusedTextures(5000);
|
||||
|
||||
#ifdef HAS_DVD_DRIVE
|
||||
// checks whats in the DVD drive and tries to autostart the content (xbox games, dvd, cdda, avi files...)
|
||||
diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp
|
||||
index 6d6c4d9..f214489 100644
|
||||
--- a/xbmc/guilib/TextureManager.cpp
|
||||
+++ b/xbmc/guilib/TextureManager.cpp
|
||||
@@ -29,6 +29,7 @@
|
||||
#ifdef _DEBUG
|
||||
#include "utils/TimeUtils.h"
|
||||
#endif
|
||||
+#include "threads/SystemClock.h"
|
||||
#include "filesystem/File.h"
|
||||
#include "filesystem/Directory.h"
|
||||
#include "URL.h"
|
||||
@@ -298,6 +299,17 @@ bool CGUITextureManager::HasTexture(const CStdString &textureName, CStdString *p
|
||||
return emptyTexture;
|
||||
}
|
||||
|
||||
+ for (ilistUnused i = m_unusedTextures.begin(); i != m_unusedTextures.end(); i++)
|
||||
+ {
|
||||
+ CTextureMap* pMap = i->first;
|
||||
+ if (pMap->GetName() == strTextureName)
|
||||
+ {
|
||||
+ m_vecTextures.push_back(pMap);
|
||||
+ m_unusedTextures.erase(i);
|
||||
+ return pMap->GetTexture();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (checkBundleOnly && bundle == -1)
|
||||
return emptyTexture;
|
||||
|
||||
@@ -439,7 +451,7 @@ void CGUITextureManager::ReleaseTexture(const CStdString& strTextureName)
|
||||
{
|
||||
//CLog::Log(LOGINFO, " cleanup:%s", strTextureName.c_str());
|
||||
// add to our textures to free
|
||||
- m_unusedTextures.push_back(pMap);
|
||||
+ m_unusedTextures.push_back(make_pair(pMap, XbmcThreads::SystemClockMillis()));
|
||||
i = m_vecTextures.erase(i);
|
||||
}
|
||||
return;
|
||||
@@ -449,12 +461,20 @@ void CGUITextureManager::ReleaseTexture(const CStdString& strTextureName)
|
||||
CLog::Log(LOGWARNING, "%s: Unable to release texture %s", __FUNCTION__, strTextureName.c_str());
|
||||
}
|
||||
|
||||
-void CGUITextureManager::FreeUnusedTextures()
|
||||
+void CGUITextureManager::FreeUnusedTextures(unsigned int timeDelay)
|
||||
{
|
||||
+ unsigned int currFrameTime = XbmcThreads::SystemClockMillis();
|
||||
CSingleLock lock(g_graphicsContext);
|
||||
- for (ivecTextures i = m_unusedTextures.begin(); i != m_unusedTextures.end(); ++i)
|
||||
- delete *i;
|
||||
- m_unusedTextures.clear();
|
||||
+ for (ilistUnused i = m_unusedTextures.begin(); i != m_unusedTextures.end();)
|
||||
+ {
|
||||
+ if (currFrameTime - i->second >= timeDelay)
|
||||
+ {
|
||||
+ delete i->first;
|
||||
+ i = m_unusedTextures.erase(i);
|
||||
+ }
|
||||
+ else
|
||||
+ i++;
|
||||
+ }
|
||||
|
||||
#if defined(HAS_GL) || defined(HAS_GLES)
|
||||
for (unsigned int i = 0; i < m_unusedHwTextures.size(); ++i)
|
||||
diff --git a/xbmc/guilib/TextureManager.h b/xbmc/guilib/TextureManager.h
|
||||
index 22fc192..2633c39d 100644
|
||||
--- a/xbmc/guilib/TextureManager.h
|
||||
+++ b/xbmc/guilib/TextureManager.h
|
||||
@@ -27,6 +27,7 @@
|
||||
#define GUILIB_TEXTUREMANAGER_H
|
||||
|
||||
#include <vector>
|
||||
+#include <list>
|
||||
#include "TextureBundle.h"
|
||||
#include "threads/CriticalSection.h"
|
||||
|
||||
@@ -121,13 +122,14 @@ class CGUITextureManager
|
||||
void SetTexturePath(const CStdString &texturePath); ///< Set a single path as the path to check when loading media (clear then add)
|
||||
void RemoveTexturePath(const CStdString &texturePath); ///< Remove a path from the paths to check when loading media
|
||||
|
||||
- void FreeUnusedTextures(); ///< Free textures (called from app thread only)
|
||||
+ void FreeUnusedTextures(unsigned int timeDelay = 0); ///< Free textures (called from app thread only)
|
||||
void ReleaseHwTexture(unsigned int texture);
|
||||
protected:
|
||||
std::vector<CTextureMap*> m_vecTextures;
|
||||
- std::vector<CTextureMap*> m_unusedTextures;
|
||||
+ std::list<std::pair<CTextureMap*, unsigned int> > m_unusedTextures;
|
||||
std::vector<unsigned int> m_unusedHwTextures;
|
||||
typedef std::vector<CTextureMap*>::iterator ivecTextures;
|
||||
+ typedef std::list<std::pair<CTextureMap*, unsigned int> >::iterator ilistUnused;
|
||||
// we have 2 texture bundles (one for the base textures, one for the theme)
|
||||
CTextureBundle m_TexBundle[2];
|
||||
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,77 +0,0 @@
|
||||
From 101fbc2d6869d6f02c4345a232854dbbb3f1a855 Mon Sep 17 00:00:00 2001
|
||||
From: Cory Fields <theuni-nospam-@xbmc.org>
|
||||
Date: Thu, 2 May 2013 16:45:41 -0400
|
||||
Subject: [PATCH] build: stop using whole-archive for our final binary
|
||||
|
||||
This nasty hack has been around for ages. By changing, we get the following
|
||||
benefits:
|
||||
|
||||
- We don't link in _every_ object in _every_ archive!
|
||||
- Builds will no longer fail if a source file has been removed but its object
|
||||
still exists in the archive
|
||||
- Filesize reduction
|
||||
- Ability to use lto, garbage collection, dead-code stripping, etc in a
|
||||
useful manner
|
||||
|
||||
This is achieved by specifying a main object on the link line, and using
|
||||
start-group/end-group to search through the archives multiple times until each
|
||||
symbol is found.
|
||||
---
|
||||
Makefile.in | 24 ++++++++++++++++--------
|
||||
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 3cbe1a2..f0827f2 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -92,6 +92,9 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
|
||||
xbmc/windows/windows.a \
|
||||
xbmc/xbmc.a \
|
||||
|
||||
+ifneq (@USE_LIBXBMC@,1)
|
||||
+DIRECTORY_ARCHIVES +=xbmc/main/main.a
|
||||
+endif
|
||||
|
||||
NWAOBJSXBMC= xbmc/threads/threads.a \
|
||||
xbmc/commons/commons.a
|
||||
@@ -425,24 +428,29 @@ endif
|
||||
|
||||
OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
|
||||
|
||||
-libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC)
|
||||
+MAINOBJS=xbmc/xbmc.o
|
||||
+ifeq (@USE_ANDROID@,1)
|
||||
+MAINOBJS+=xbmc/android/activity/android_main.o
|
||||
+endif
|
||||
+ifneq (@USE_LIBXBMC@,1)
|
||||
+MAINOBJS+=xbmc/main/main.o
|
||||
+endif
|
||||
+
|
||||
+libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
|
||||
ifeq ($(findstring osx,@ARCH@), osx)
|
||||
$(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS)
|
||||
else
|
||||
- $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
|
||||
+ $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
|
||||
endif
|
||||
|
||||
-xbmc.bin: xbmc/main/main.a $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC)
|
||||
+xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
|
||||
|
||||
ifeq ($(findstring osx,@ARCH@), osx)
|
||||
- $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) xbmc/main/main.a $(LIBS) -rdynamic
|
||||
+ $(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
|
||||
else
|
||||
- $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) xbmc/main/main.a -Wl,--no-whole-archive $(NWAOBJSXBMC) $(LIBS) -rdynamic
|
||||
+ $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o xbmc.bin $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group $(NWAOBJSXBMC) $(LIBS) -rdynamic
|
||||
endif
|
||||
|
||||
-xbmc/main/main.a: force
|
||||
- $(MAKE) -C xbmc/main
|
||||
-
|
||||
xbmc-xrandr: xbmc-xrandr.c
|
||||
ifneq (1,@USE_XRANDR@)
|
||||
# xbmc-xrandr.c gets picked up by the default make rules
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,89 +0,0 @@
|
||||
From 0aaeb72ed3d76134f11b80a4d17e50b40d6459be Mon Sep 17 00:00:00 2001
|
||||
From: hmis <hubert.mis@gmail.com>
|
||||
Date: Mon, 8 Apr 2013 21:35:35 +0300
|
||||
Subject: [PATCH] Read CD audio USB drive bug fixed
|
||||
|
||||
libcdio seems to allow read no more than about 10 audio sectors at once when CD audio device is connected via USB.
|
||||
This patch makes XBMC read small number of sectors if default one fails. It uses more CPU but allows to use USB CD devices.
|
||||
Tested on GNU/Linux x86 and RPi. (On Rpi OMXPlayer does not play CD, but I can rip tracks).
|
||||
---
|
||||
xbmc/filesystem/CDDAFile.cpp | 34 +++++++++++++++++++++++++++-------
|
||||
xbmc/filesystem/CDDAFile.h | 1 +
|
||||
2 files changed, 28 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/xbmc/filesystem/CDDAFile.cpp b/xbmc/filesystem/CDDAFile.cpp
|
||||
index 5342629..f5eaf37 100644
|
||||
--- a/xbmc/filesystem/CDDAFile.cpp
|
||||
+++ b/xbmc/filesystem/CDDAFile.cpp
|
||||
@@ -40,6 +40,7 @@
|
||||
m_lsnCurrent = CDIO_INVALID_LSN;
|
||||
m_lsnEnd = CDIO_INVALID_LSN;
|
||||
m_cdio = CLibcdio::GetInstance();
|
||||
+ m_iSectorCount = 52;
|
||||
}
|
||||
|
||||
CFileCDDA::~CFileCDDA(void)
|
||||
@@ -120,7 +121,8 @@ unsigned int CFileCDDA::Read(void* lpBuf, int64_t uiBufSize)
|
||||
if (!m_pCdIo || !g_mediaManager.IsDiscInDrive())
|
||||
return 0;
|
||||
|
||||
- int iSectorCount = (int)uiBufSize / CDIO_CD_FRAMESIZE_RAW;
|
||||
+ // limit number of sectors that fits in buffer by m_iSectorCount
|
||||
+ int iSectorCount = std::min((int)uiBufSize / CDIO_CD_FRAMESIZE_RAW, m_iSectorCount);
|
||||
|
||||
if (iSectorCount <= 0)
|
||||
return 0;
|
||||
@@ -129,14 +131,32 @@ unsigned int CFileCDDA::Read(void* lpBuf, int64_t uiBufSize)
|
||||
if (m_lsnCurrent + iSectorCount > m_lsnEnd)
|
||||
iSectorCount = m_lsnEnd - m_lsnCurrent;
|
||||
|
||||
- int iret = m_cdio->cdio_read_audio_sectors(m_pCdIo, lpBuf, m_lsnCurrent, iSectorCount);
|
||||
-
|
||||
- if ( iret != DRIVER_OP_SUCCESS)
|
||||
+ // The loop tries to solve read error problem by lowering number of sectors to read (iSectorCount).
|
||||
+ // When problem is solved the proper number of sectors is stored in m_iSectorCount
|
||||
+ int big_iSectorCount = iSectorCount;
|
||||
+ while (iSectorCount > 0)
|
||||
{
|
||||
- CLog::Log(LOGERROR, "file cdda: Reading %d sectors of audio data starting at lsn %d failed with error code %i", iSectorCount, m_lsnCurrent, iret);
|
||||
- return 0;
|
||||
+ int iret = m_cdio->cdio_read_audio_sectors(m_pCdIo, lpBuf, m_lsnCurrent, iSectorCount);
|
||||
+
|
||||
+ if (iret == DRIVER_OP_SUCCESS)
|
||||
+ {
|
||||
+ // If lower iSectorCount solved the problem limit it's value
|
||||
+ if (iSectorCount < big_iSectorCount)
|
||||
+ {
|
||||
+ m_iSectorCount = iSectorCount;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ // iSectorCount is low so it cannot solve read problem
|
||||
+ if (iSectorCount <= 10)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "file cdda: Reading %d sectors of audio data starting at lsn %d failed with error code %i", iSectorCount, m_lsnCurrent, iret);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ iSectorCount = 10;
|
||||
}
|
||||
-
|
||||
m_lsnCurrent += iSectorCount;
|
||||
|
||||
return iSectorCount*CDIO_CD_FRAMESIZE_RAW;
|
||||
diff --git a/xbmc/filesystem/CDDAFile.h b/xbmc/filesystem/CDDAFile.h
|
||||
index f041e0b..72b8d5b 100644
|
||||
--- a/xbmc/filesystem/CDDAFile.h
|
||||
+++ b/xbmc/filesystem/CDDAFile.h
|
||||
@@ -53,6 +53,7 @@ class CFileCDDA : public IFile
|
||||
lsn_t m_lsnStart; // Start of m_iTrack in logical sector number
|
||||
lsn_t m_lsnCurrent; // Position inside the track in logical sector number
|
||||
lsn_t m_lsnEnd; // End of m_iTrack in logical sector number
|
||||
+ int m_iSectorCount; // max number of sectors to read at once
|
||||
boost::shared_ptr<MEDIA_DETECT::CLibcdio> m_cdio;
|
||||
};
|
||||
}
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,555 +0,0 @@
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.cpp xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.cpp 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.cpp 2013-05-10 07:16:56.061904946 +0200
|
||||
@@ -0,0 +1,180 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2013 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, see
|
||||
+ * <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "DVDInputStreams/DVDInputStream.h"
|
||||
+#include "DVDDemuxCDDA.h"
|
||||
+#include "DVDDemuxUtils.h"
|
||||
+#include "utils/log.h"
|
||||
+#include "../DVDClock.h"
|
||||
+
|
||||
+// CDDA audio demuxer based on AirTunes audio Demuxer.
|
||||
+
|
||||
+using namespace std;
|
||||
+
|
||||
+class CDemuxStreamAudioCDDA
|
||||
+ : public CDemuxStreamAudio
|
||||
+{
|
||||
+public:
|
||||
+ void GetStreamInfo(string& strInfo)
|
||||
+ {
|
||||
+ strInfo = "pcm";
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+CDVDDemuxCDDA::CDVDDemuxCDDA() : CDVDDemux()
|
||||
+{
|
||||
+ m_pInput = NULL;
|
||||
+ m_stream = NULL;
|
||||
+ m_bytes = 0;
|
||||
+}
|
||||
+
|
||||
+CDVDDemuxCDDA::~CDVDDemuxCDDA()
|
||||
+{
|
||||
+ Dispose();
|
||||
+}
|
||||
+
|
||||
+bool CDVDDemuxCDDA::Open(CDVDInputStream* pInput)
|
||||
+{
|
||||
+ Abort();
|
||||
+
|
||||
+ Dispose();
|
||||
+
|
||||
+ if(!pInput || !pInput->IsStreamType(DVDSTREAM_TYPE_FILE))
|
||||
+ return false;
|
||||
+
|
||||
+ m_pInput = pInput;
|
||||
+
|
||||
+ m_stream = new CDemuxStreamAudioCDDA();
|
||||
+
|
||||
+ if(!m_stream)
|
||||
+ return false;
|
||||
+
|
||||
+ m_stream->iSampleRate = 44100;
|
||||
+ m_stream->iBitsPerSample = 16;
|
||||
+ m_stream->iBitRate = 44100 * 2 * 16;
|
||||
+ m_stream->iChannels = 2;
|
||||
+ m_stream->type = STREAM_AUDIO;
|
||||
+ m_stream->codec = CODEC_ID_PCM_S16LE;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+void CDVDDemuxCDDA::Dispose()
|
||||
+{
|
||||
+ delete m_stream;
|
||||
+ m_stream = NULL;
|
||||
+
|
||||
+ m_pInput = NULL;
|
||||
+ m_bytes = 0;
|
||||
+}
|
||||
+
|
||||
+void CDVDDemuxCDDA::Reset()
|
||||
+{
|
||||
+ CDVDInputStream* pInputStream = m_pInput;
|
||||
+ Dispose();
|
||||
+ Open(pInputStream);
|
||||
+}
|
||||
+
|
||||
+void CDVDDemuxCDDA::Abort()
|
||||
+{
|
||||
+ if(m_pInput)
|
||||
+ return m_pInput->Abort();
|
||||
+}
|
||||
+
|
||||
+void CDVDDemuxCDDA::Flush()
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#define CDDA_READ_SIZE 4096
|
||||
+DemuxPacket* CDVDDemuxCDDA::Read()
|
||||
+{
|
||||
+ if(!m_pInput)
|
||||
+ return NULL;
|
||||
+
|
||||
+ DemuxPacket* pPacket = CDVDDemuxUtils::AllocateDemuxPacket(CDDA_READ_SIZE);
|
||||
+
|
||||
+ if (!pPacket)
|
||||
+ {
|
||||
+ if (m_pInput)
|
||||
+ m_pInput->Close();
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ pPacket->iSize = m_pInput->Read(pPacket->pData, CDDA_READ_SIZE);
|
||||
+ pPacket->iStreamId = 0;
|
||||
+
|
||||
+ if(pPacket->iSize < 1)
|
||||
+ {
|
||||
+ delete pPacket;
|
||||
+ pPacket = NULL;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ int n = m_stream->iBitRate>>3;
|
||||
+ if (n > 0)
|
||||
+ {
|
||||
+ m_bytes += pPacket->iSize;
|
||||
+ pPacket->dts = (double)m_bytes * DVD_TIME_BASE / n;
|
||||
+ pPacket->pts = pPacket->dts;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ pPacket->dts = DVD_NOPTS_VALUE;
|
||||
+ pPacket->pts = DVD_NOPTS_VALUE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return pPacket;
|
||||
+}
|
||||
+
|
||||
+int CDVDDemuxCDDA::GetStreamLength()
|
||||
+{
|
||||
+ int64_t num_track_bytes = m_pInput->GetLength();
|
||||
+ int bytes_per_second = (m_stream->iBitRate>>3);
|
||||
+ int64_t track_mseconds = num_track_bytes*1000 / bytes_per_second;
|
||||
+ return (int)track_mseconds;
|
||||
+}
|
||||
+
|
||||
+CDemuxStream* CDVDDemuxCDDA::GetStream(int iStreamId)
|
||||
+{
|
||||
+ if(iStreamId != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return m_stream;
|
||||
+}
|
||||
+
|
||||
+int CDVDDemuxCDDA::GetNrOfStreams()
|
||||
+{
|
||||
+ return (m_stream == NULL ? 0 : 1);
|
||||
+}
|
||||
+
|
||||
+std::string CDVDDemuxCDDA::GetFileName()
|
||||
+{
|
||||
+ if(m_pInput)
|
||||
+ return m_pInput->GetFileName();
|
||||
+ else
|
||||
+ return "";
|
||||
+}
|
||||
+
|
||||
+void CDVDDemuxCDDA::GetStreamCodecName(int iStreamId, CStdString &strName)
|
||||
+{
|
||||
+ if (m_stream && iStreamId == 0)
|
||||
+ strName = "pcm";
|
||||
+}
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.h xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.h
|
||||
--- xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCDDA.h 2013-05-10 07:16:56.061904946 +0200
|
||||
@@ -0,0 +1,59 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * Copyright (C) 2013 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, see
|
||||
+ * <http://www.gnu.org/licenses/>.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "DVDDemux.h"
|
||||
+
|
||||
+#ifdef _WIN32
|
||||
+#define __attribute__(dummy_val)
|
||||
+#else
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+class CDemuxStreamAudioCDDA;
|
||||
+
|
||||
+class CDVDDemuxCDDA : public CDVDDemux
|
||||
+{
|
||||
+public:
|
||||
+
|
||||
+ CDVDDemuxCDDA();
|
||||
+ ~CDVDDemuxCDDA();
|
||||
+
|
||||
+ bool Open(CDVDInputStream* pInput);
|
||||
+ void Dispose();
|
||||
+ void Reset();
|
||||
+ void Abort();
|
||||
+ void Flush();
|
||||
+ DemuxPacket* Read();
|
||||
+ bool SeekTime(int time, bool backwords = false, double* startpts = NULL) { return false; };
|
||||
+ void SetSpeed(int iSpeed) {};
|
||||
+ int GetStreamLength() ;
|
||||
+ CDemuxStream* GetStream(int iStreamId);
|
||||
+ int GetNrOfStreams();
|
||||
+ std::string GetFileName();
|
||||
+ virtual void GetStreamCodecName(int iStreamId, CStdString &strName);
|
||||
+
|
||||
+protected:
|
||||
+ friend class CDemuxStreamAudioCDDA;
|
||||
+ CDVDInputStream* m_pInput;
|
||||
+ int64_t m_bytes;
|
||||
+
|
||||
+ CDemuxStreamAudioCDDA *m_stream;
|
||||
+};
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp 2013-05-02 17:00:07.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp 2013-05-10 07:16:56.061904946 +0200
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "DVDDemuxHTSP.h"
|
||||
#endif
|
||||
#include "DVDDemuxBXA.h"
|
||||
+#include "DVDDemuxCDDA.h"
|
||||
#include "DVDDemuxPVRClient.h"
|
||||
#include "pvr/PVRManager.h"
|
||||
#include "pvr/addons/PVRClients.h"
|
||||
@@ -51,6 +52,22 @@
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
+ // Try to open CDDA demuxer
|
||||
+ if (pInputStream->IsStreamType(DVDSTREAM_TYPE_FILE) && pInputStream->GetContent().compare("application/octet-stream") == 0)
|
||||
+ {
|
||||
+ std::string filename = pInputStream->GetFileName();
|
||||
+ if (filename.substr(0, 7) == "cdda://")
|
||||
+ {
|
||||
+ CLog::Log(LOGDEBUG, "DVDFactoryDemuxer: Stream is probably CD audio. Creating CDDA demuxer.");
|
||||
+
|
||||
+ auto_ptr<CDVDDemuxCDDA> demuxer(new CDVDDemuxCDDA());
|
||||
+ if (demuxer->Open(pInputStream))
|
||||
+ {
|
||||
+ return demuxer.release();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (pInputStream->IsStreamType(DVDSTREAM_TYPE_HTTP))
|
||||
{
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp.orig xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp.orig
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
|
||||
--- xbmc-12.2.0/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in 2013-05-02 17:00:07.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in 2013-05-10 07:16:56.061904946 +0200
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
SRCS = DVDDemux.cpp
|
||||
SRCS += DVDDemuxBXA.cpp
|
||||
+SRCS += DVDDemuxCDDA.cpp
|
||||
SRCS += DVDDemuxFFmpeg.cpp
|
||||
SRCS += DVDDemuxHTSP.cpp
|
||||
SRCS += DVDDemuxPVRClient.cpp
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/paplayer/CDDAcodec.cpp xbmc-12.2.0.patch/xbmc/cores/paplayer/CDDAcodec.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/paplayer/CDDAcodec.cpp 2013-05-02 17:00:08.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/paplayer/CDDAcodec.cpp 1970-01-01 01:00:00.000000000 +0100
|
||||
@@ -1,159 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (C) 2005-2012 Team XBMC
|
||||
- * http://www.xbmc.org
|
||||
- *
|
||||
- * This Program is free software; you can redistribute it and/or modify
|
||||
- * it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2, or (at your option)
|
||||
- * any later version.
|
||||
- *
|
||||
- * This Program is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License
|
||||
- * along with XBMC; see the file COPYING. If not, see
|
||||
- * <http://www.gnu.org/licenses/>.
|
||||
- *
|
||||
- */
|
||||
-
|
||||
-#include "CDDAcodec.h"
|
||||
-#if !defined(TARGET_DARWIN_IOS)
|
||||
-#include <cdio/sector.h>
|
||||
-#else
|
||||
-typedef int32_t lsn_t;
|
||||
-#define CDIO_CD_FRAMESIZE_RAW 2352
|
||||
-#define CDIO_CD_FRAMES_PER_SEC 75
|
||||
-#endif
|
||||
-#include "cores/AudioEngine/Utils/AEUtil.h"
|
||||
-
|
||||
-#define SECTOR_COUNT 55 // max. sectors that can be read at once
|
||||
-#define MAX_BUFFER_SIZE 2*SECTOR_COUNT*CDIO_CD_FRAMESIZE_RAW
|
||||
-
|
||||
-CDDACodec::CDDACodec()
|
||||
-{
|
||||
- m_SampleRate = 44100;
|
||||
- m_Channels = 2;
|
||||
- m_BitsPerSample = 16;
|
||||
- m_DataFormat = AE_FMT_S16NE;
|
||||
- m_TotalTime = 0;
|
||||
- m_Bitrate = 0;
|
||||
- m_CodecName = "cdda";
|
||||
-
|
||||
- m_BufferSize=0;
|
||||
- m_Buffer = new BYTE[MAX_BUFFER_SIZE];
|
||||
- m_BufferPos = 0;
|
||||
-}
|
||||
-
|
||||
-CDDACodec::~CDDACodec()
|
||||
-{
|
||||
- DeInit();
|
||||
-
|
||||
- if (m_Buffer)
|
||||
- {
|
||||
- delete[] m_Buffer;
|
||||
- m_Buffer = NULL;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-bool CDDACodec::Init(const CStdString &strFile, unsigned int filecache)
|
||||
-{
|
||||
- if (!m_file.Open(strFile, READ_CACHED))
|
||||
- return false;
|
||||
-
|
||||
- // Calculate total time of the track
|
||||
- m_TotalTime=(m_file.GetLength()/CDIO_CD_FRAMESIZE_RAW)/CDIO_CD_FRAMES_PER_SEC;
|
||||
- if (m_TotalTime > 0)
|
||||
- m_Bitrate = (int)((m_file.GetLength() * 8) / m_TotalTime);
|
||||
- else
|
||||
- m_Bitrate = 0;
|
||||
- m_TotalTime*=1000; // ms
|
||||
- return true;
|
||||
-}
|
||||
-
|
||||
-void CDDACodec::DeInit()
|
||||
-{
|
||||
- m_file.Close();
|
||||
-}
|
||||
-
|
||||
-int64_t CDDACodec::Seek(int64_t iSeekTime)
|
||||
-{
|
||||
- // Calculate the next full second...
|
||||
- int iSeekTimeFullSec=(int)(iSeekTime+(1000-(iSeekTime%1000)))/1000;
|
||||
-
|
||||
- // ...and the logical sector on the cd...
|
||||
- lsn_t lsnSeek=iSeekTimeFullSec*CDIO_CD_FRAMES_PER_SEC;
|
||||
-
|
||||
- // ... then seek to its position...
|
||||
- int iNewOffset=(int)m_file.Seek(lsnSeek*CDIO_CD_FRAMESIZE_RAW, SEEK_SET);
|
||||
- m_BufferSize=m_BufferPos=0;
|
||||
-
|
||||
- // ... and look if we really got there.
|
||||
- int iNewSeekTime=(iNewOffset/CDIO_CD_FRAMESIZE_RAW)/CDIO_CD_FRAMES_PER_SEC;
|
||||
- return iNewSeekTime*(int64_t)1000; // ms
|
||||
-}
|
||||
-
|
||||
-int CDDACodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize)
|
||||
-{
|
||||
- *actualsize=0;
|
||||
-
|
||||
- bool bEof=false;
|
||||
- // Reached end of track?
|
||||
- if (m_file.GetLength()==m_file.GetPosition())
|
||||
- bEof=true;
|
||||
-
|
||||
- // Do we have to refill our audio buffer?
|
||||
- if (m_BufferSize-m_BufferPos<MAX_BUFFER_SIZE/2 && !bEof)
|
||||
- {
|
||||
- // Move the remaining audio data to the beginning of the buffer
|
||||
- memmove(m_Buffer, m_Buffer + m_BufferPos, m_BufferSize-m_BufferPos);
|
||||
- m_BufferSize=m_BufferSize-m_BufferPos;
|
||||
- m_BufferPos = 0;
|
||||
-
|
||||
- // Fill our buffer with a chunk of audio data
|
||||
- int iAmountRead=m_file.Read(m_Buffer+m_BufferSize, MAX_BUFFER_SIZE/2);
|
||||
- if (iAmountRead<=0)
|
||||
- return READ_ERROR;
|
||||
-
|
||||
- m_BufferSize+=iAmountRead;
|
||||
- }
|
||||
-
|
||||
- // Our buffer is empty and no data left to read from the cd
|
||||
- if (m_BufferSize-m_BufferPos==0 && bEof)
|
||||
- return READ_EOF;
|
||||
-
|
||||
- // Try to give the player the amount of audio data he wants
|
||||
- if (m_BufferSize-m_BufferPos>=size)
|
||||
- { // we have enough data in our buffer
|
||||
- memcpy(pBuffer, m_Buffer + m_BufferPos, size);
|
||||
- m_BufferPos+=size;
|
||||
- *actualsize=size;
|
||||
- }
|
||||
- else
|
||||
- { // Only a smaller amount of data left as the player wants
|
||||
- memcpy(pBuffer, m_Buffer + m_BufferPos, m_BufferSize-m_BufferPos);
|
||||
- *actualsize=m_BufferSize-m_BufferPos;
|
||||
- m_BufferPos+=m_BufferSize-m_BufferPos;
|
||||
- }
|
||||
-
|
||||
- return READ_SUCCESS;
|
||||
-}
|
||||
-
|
||||
-bool CDDACodec::CanInit()
|
||||
-{
|
||||
- return true;
|
||||
-}
|
||||
-
|
||||
-CAEChannelInfo CDDACodec::GetChannelInfo()
|
||||
-{
|
||||
- static enum AEChannel map[2][3] = {
|
||||
- {AE_CH_FC, AE_CH_NULL},
|
||||
- {AE_CH_FL, AE_CH_FR , AE_CH_NULL}
|
||||
- };
|
||||
-
|
||||
- if (m_Channels > 2)
|
||||
- return CAEUtil::GuessChLayout(m_Channels);
|
||||
-
|
||||
- return CAEChannelInfo(map[m_Channels - 1]);
|
||||
-}
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/paplayer/CDDAcodec.h xbmc-12.2.0.patch/xbmc/cores/paplayer/CDDAcodec.h
|
||||
--- xbmc-12.2.0/xbmc/cores/paplayer/CDDAcodec.h 2013-05-02 17:00:08.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/paplayer/CDDAcodec.h 1970-01-01 01:00:00.000000000 +0100
|
||||
@@ -1,43 +0,0 @@
|
||||
-#pragma once
|
||||
-
|
||||
-/*
|
||||
- * Copyright (C) 2005-2012 Team XBMC
|
||||
- * http://www.xbmc.org
|
||||
- *
|
||||
- * This Program is free software; you can redistribute it and/or modify
|
||||
- * it under the terms of the GNU General Public License as published by
|
||||
- * the Free Software Foundation; either version 2, or (at your option)
|
||||
- * any later version.
|
||||
- *
|
||||
- * This Program is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License
|
||||
- * along with XBMC; see the file COPYING. If not, see
|
||||
- * <http://www.gnu.org/licenses/>.
|
||||
- *
|
||||
- */
|
||||
-
|
||||
-#include "CachingCodec.h"
|
||||
-
|
||||
-class CDDACodec : public CachingCodec
|
||||
-{
|
||||
-public:
|
||||
- CDDACodec();
|
||||
- virtual ~CDDACodec();
|
||||
-
|
||||
- virtual bool Init(const CStdString &strFile, unsigned int filecache);
|
||||
- virtual void DeInit();
|
||||
- virtual int64_t Seek(int64_t iSeekTime);
|
||||
- virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize);
|
||||
- virtual bool CanInit();
|
||||
- virtual CAEChannelInfo GetChannelInfo();
|
||||
-
|
||||
-private:
|
||||
- // Input buffer to read our cdda data into
|
||||
- BYTE* m_Buffer;
|
||||
- int m_BufferSize;
|
||||
- int m_BufferPos;
|
||||
-};
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/paplayer/CodecFactory.cpp xbmc-12.2.0.patch/xbmc/cores/paplayer/CodecFactory.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/paplayer/CodecFactory.cpp 2013-05-02 17:00:08.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/paplayer/CodecFactory.cpp 2013-05-10 07:16:56.061904946 +0200
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "system.h"
|
||||
#include "CodecFactory.h"
|
||||
#include "MP3codec.h"
|
||||
-#include "CDDAcodec.h"
|
||||
#include "OGGcodec.h"
|
||||
#include "FLACcodec.h"
|
||||
#include "WAVcodec.h"
|
||||
@@ -51,7 +50,7 @@
|
||||
else if (strFileType.Equals("ape") || strFileType.Equals("mac"))
|
||||
return new DVDPlayerCodec();
|
||||
else if (strFileType.Equals("cdda"))
|
||||
- return new CDDACodec();
|
||||
+ return new DVDPlayerCodec();
|
||||
else if (strFileType.Equals("mpc") || strFileType.Equals("mp+") || strFileType.Equals("mpp"))
|
||||
return new DVDPlayerCodec();
|
||||
else if (strFileType.Equals("shn"))
|
||||
@@ -183,20 +182,6 @@
|
||||
}
|
||||
delete codec;
|
||||
}
|
||||
- if (urlFile.GetFileType().Equals("cdda"))
|
||||
- {
|
||||
- //lets see what it contains...
|
||||
- //this kinda sucks 'cause if it's plain cdda the file
|
||||
- //will be opened, sniffed and closed before it is opened *again* for cdda
|
||||
- //would be better if the papcodecs could work with bitstreams instead of filenames.
|
||||
- DVDPlayerCodec *dvdcodec = new DVDPlayerCodec();
|
||||
- dvdcodec->SetContentType("audio/x-spdif-compressed");
|
||||
- if (dvdcodec->Init(strFile, filecache))
|
||||
- {
|
||||
- return dvdcodec;
|
||||
- }
|
||||
- delete dvdcodec;
|
||||
- }
|
||||
else if (urlFile.GetFileType().Equals("ogg") || urlFile.GetFileType().Equals("oggstream") || urlFile.GetFileType().Equals("oga"))
|
||||
return CreateOGGCodec(strFile,filecache);
|
||||
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/paplayer/Makefile.in xbmc-12.2.0.patch/xbmc/cores/paplayer/Makefile.in
|
||||
--- xbmc-12.2.0/xbmc/cores/paplayer/Makefile.in 2013-05-02 17:00:08.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/paplayer/Makefile.in 2013-05-10 07:16:56.062904942 +0200
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
SRCS = ADPCMCodec.cpp
|
||||
SRCS += AudioDecoder.cpp
|
||||
-SRCS += CDDAcodec.cpp
|
||||
SRCS += CodecFactory.cpp
|
||||
SRCS += DVDPlayerCodec.cpp
|
||||
SRCS += FLACcodec.cpp
|
@ -1,32 +0,0 @@
|
||||
From 5b75f44b448bcefb9b802a3a28d0e6846284d22e Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Mon, 6 May 2013 14:20:05 +0100
|
||||
Subject: [PATCH] [rbp/omxplayer] Fix for hang following seek after eos
|
||||
|
||||
If you seek after the demuxer eof, the eof state is cleared, but we are not clearing the flags relating to sending eos stream to audio/video players
|
||||
---
|
||||
xbmc/cores/omxplayer/OMXPlayer.cpp | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp
|
||||
index 156a3ad..82d0024 100644
|
||||
--- a/xbmc/cores/omxplayer/OMXPlayer.cpp
|
||||
+++ b/xbmc/cores/omxplayer/OMXPlayer.cpp
|
||||
@@ -1178,7 +1178,13 @@ void COMXPlayer::Process()
|
||||
CDVDDemuxUtils::FreeDemuxPacket(pPacket);
|
||||
continue;
|
||||
}
|
||||
-
|
||||
+ if (pPacket)
|
||||
+ {
|
||||
+ // reset eos state when we get a packet (e.g. for case of seek after eos)
|
||||
+ bOmxWaitVideo = false;
|
||||
+ bOmxWaitAudio = false;
|
||||
+ bOmxSentEOFs = false;
|
||||
+ }
|
||||
if (!pPacket)
|
||||
{
|
||||
// when paused, demuxer could be be returning empty
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,322 +0,0 @@
|
||||
From 85891c135b848d8f11a5410d867f67e0515d3d0b Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@ecce.se>
|
||||
Date: Sun, 17 Mar 2013 19:04:52 +0100
|
||||
Subject: [PATCH 1/3] dvdplayer: move CanSeek/CanPause to seekable interface
|
||||
|
||||
---
|
||||
.../dvdplayer/DVDInputStreams/DVDInputStream.h | 8 ++++++++
|
||||
.../DVDInputStreams/DVDInputStreamPVRManager.h | 1 +
|
||||
xbmc/cores/dvdplayer/DVDPlayer.cpp | 22 +++++++++++-----------
|
||||
3 files changed, 20 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
index b3b7ae3..a5ee3ae 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
@@ -122,6 +122,14 @@ class CDVDInputStream
|
||||
virtual double GetTimeStampCorrection() = 0;
|
||||
};
|
||||
|
||||
+ class ISeekable
|
||||
+ {
|
||||
+ public:
|
||||
+ virtual ~ISeekable() {};
|
||||
+ virtual bool CanSeek() = 0;
|
||||
+ virtual bool CanPause() = 0;
|
||||
+ };
|
||||
+
|
||||
enum ENextStream
|
||||
{
|
||||
NEXTSTREAM_NONE,
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h
|
||||
index 79389a4..89f05a7 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h
|
||||
@@ -39,6 +39,7 @@ class CDVDInputStreamPVRManager
|
||||
: public CDVDInputStream
|
||||
, public CDVDInputStream::IChannel
|
||||
, public CDVDInputStream::IDisplayTime
|
||||
+ , public CDVDInputStream::ISeekable
|
||||
{
|
||||
public:
|
||||
CDVDInputStreamPVRManager(IDVDPlayer* pPlayer);
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
index e5a1e71..5baf57a 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
@@ -3833,6 +3833,9 @@ void CDVDPlayer::UpdatePlayState(double timeout)
|
||||
state.time_src = ETIMESOURCE_CLOCK;
|
||||
}
|
||||
|
||||
+ state.canpause = true;
|
||||
+ state.canseek = true;
|
||||
+
|
||||
if(m_pInputStream)
|
||||
{
|
||||
// override from input stream if needed
|
||||
@@ -3861,16 +3864,10 @@ void CDVDPlayer::UpdatePlayState(double timeout)
|
||||
}
|
||||
}
|
||||
|
||||
- if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER))
|
||||
- {
|
||||
- CDVDInputStreamPVRManager* pvrinputstream = static_cast<CDVDInputStreamPVRManager*>(m_pInputStream);
|
||||
- state.canpause = pvrinputstream->CanPause();
|
||||
- state.canseek = pvrinputstream->CanSeek();
|
||||
- }
|
||||
- else
|
||||
+ if (CDVDInputStream::ISeekable* ptr = dynamic_cast<CDVDInputStream::ISeekable*>(m_pInputStream))
|
||||
{
|
||||
- state.canseek = state.time_total > 0 ? true : false;
|
||||
- state.canpause = true;
|
||||
+ state.canpause = ptr->CanPause();
|
||||
+ state.canseek = ptr->CanSeek();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3880,10 +3877,13 @@ void CDVDPlayer::UpdatePlayState(double timeout)
|
||||
state.time_total = m_Edl.RemoveCutTime(llrint(state.time_total));
|
||||
}
|
||||
|
||||
+ if(state.time_total <= 0)
|
||||
+ state.canseek = false;
|
||||
+
|
||||
state.player_state = "";
|
||||
- if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
|
||||
+ if(CDVDInputStreamNavigator* ptr = dynamic_cast<CDVDInputStreamNavigator*>(m_pInputStream))
|
||||
{
|
||||
- if(!((CDVDInputStreamNavigator*)m_pInputStream)->GetNavigatorState(state.player_state))
|
||||
+ if(!ptr->GetNavigatorState(state.player_state))
|
||||
state.player_state = "";
|
||||
}
|
||||
|
||||
--
|
||||
1.8.1.6
|
||||
|
||||
|
||||
From c817ed00d875174b6789621aba4dc15123c4f3bd Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@ecce.se>
|
||||
Date: Sun, 17 Mar 2013 19:15:13 +0100
|
||||
Subject: [PATCH 2/3] dvdplayer: disable seeking and pause for udp/rtp and seek
|
||||
for tcp
|
||||
|
||||
---
|
||||
.../dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp | 17 +++++++++++++++++
|
||||
.../dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h | 9 ++++++++-
|
||||
2 files changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp
|
||||
index 72ea5f8..fb5001a 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp
|
||||
@@ -47,7 +47,24 @@ bool CDVDInputStreamFFmpeg::Open(const char* strFile, const std::string& content
|
||||
if (!CDVDInputStream::Open(strFile, content))
|
||||
return false;
|
||||
|
||||
+ m_can_pause = true;
|
||||
+ m_can_seek = true;
|
||||
+
|
||||
+ if(strnicmp(strFile, "udp://", 6) == 0
|
||||
+ || strnicmp(strFile, "rtp://", 6) == 0)
|
||||
+ {
|
||||
+ m_can_pause = false;
|
||||
+ m_can_seek = false;
|
||||
+ }
|
||||
+
|
||||
+ if(strnicmp(strFile, "tcp://", 6) == 0)
|
||||
+ {
|
||||
+ m_can_pause = true;
|
||||
+ m_can_seek = false;
|
||||
+ }
|
||||
+
|
||||
m_aborted = false;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h
|
||||
index 6149233..cf80e8f 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h
|
||||
@@ -22,7 +22,9 @@
|
||||
|
||||
#include "DVDInputStream.h"
|
||||
|
||||
-class CDVDInputStreamFFmpeg : public CDVDInputStream
|
||||
+class CDVDInputStreamFFmpeg
|
||||
+ : public CDVDInputStream
|
||||
+ , public CDVDInputStream::ISeekable
|
||||
{
|
||||
public:
|
||||
CDVDInputStreamFFmpeg();
|
||||
@@ -38,6 +40,11 @@ class CDVDInputStreamFFmpeg : public CDVDInputStream
|
||||
virtual void Abort() { m_aborted = true; }
|
||||
bool Aborted() { return m_aborted; }
|
||||
|
||||
+ bool CanSeek() { return m_can_seek; }
|
||||
+ bool CanPause() { return m_can_pause; }
|
||||
+
|
||||
protected:
|
||||
bool m_aborted;
|
||||
+ bool m_can_pause;
|
||||
+ bool m_can_seek;
|
||||
};
|
||||
--
|
||||
1.8.1.6
|
||||
|
||||
|
||||
From 20562d6450d481967833de7895cd27352a4fdea1 Mon Sep 17 00:00:00 2001
|
||||
From: Wolfgang Haupt <w.haupt@at-visions.com>
|
||||
Date: Tue, 7 May 2013 09:43:03 +0200
|
||||
Subject: [PATCH 3/3] dvdplayer: move navigator state into IMenus
|
||||
|
||||
---
|
||||
.../dvdplayer/DVDInputStreams/DVDInputStream.h | 2 ++
|
||||
.../DVDInputStreams/DVDInputStreamBluray.h | 2 ++
|
||||
.../DVDInputStreams/DVDInputStreamNavigator.cpp | 4 +--
|
||||
.../DVDInputStreams/DVDInputStreamNavigator.h | 4 +--
|
||||
xbmc/cores/dvdplayer/DVDPlayer.cpp | 38 ++++++++++------------
|
||||
5 files changed, 25 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
index a5ee3ae..76414b2 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h
|
||||
@@ -120,6 +120,8 @@ class CDVDInputStream
|
||||
virtual bool OnMouseClick(const CPoint &point) = 0;
|
||||
virtual bool IsInMenu() = 0;
|
||||
virtual double GetTimeStampCorrection() = 0;
|
||||
+ virtual bool GetState(std::string &xmlstate) { return false; }
|
||||
+ virtual bool SetState(const std::string &xmlstate) { return false; }
|
||||
};
|
||||
|
||||
class ISeekable
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h
|
||||
index 6897d0f..a7d8f6b 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h
|
||||
@@ -81,6 +81,8 @@ class CDVDInputStreamBluray
|
||||
virtual bool OnMouseMove(const CPoint &point) { return false; }
|
||||
virtual bool OnMouseClick(const CPoint &point) { return false; }
|
||||
virtual double GetTimeStampCorrection() { return 0.0; }
|
||||
+ virtual bool GetState(std::string &xmlstate) { return false; }
|
||||
+ virtual bool SetState(const std::string &xmlstate) { return false; }
|
||||
|
||||
void UserInput(bd_vk_key_e vk);
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
|
||||
index 9cd8cf9..102b862 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp
|
||||
@@ -1144,7 +1144,7 @@ bool CDVDInputStreamNavigator::IsSubtitleStreamEnabled()
|
||||
return false;
|
||||
}
|
||||
|
||||
-bool CDVDInputStreamNavigator::GetNavigatorState(std::string &xmlstate)
|
||||
+bool CDVDInputStreamNavigator::GetState(std::string &xmlstate)
|
||||
{
|
||||
if( !m_dvdnav )
|
||||
return false;
|
||||
@@ -1165,7 +1165,7 @@ bool CDVDInputStreamNavigator::GetNavigatorState(std::string &xmlstate)
|
||||
return true;
|
||||
}
|
||||
|
||||
-bool CDVDInputStreamNavigator::SetNavigatorState(std::string &xmlstate)
|
||||
+bool CDVDInputStreamNavigator::SetState(const std::string &xmlstate)
|
||||
{
|
||||
if( !m_dvdnav )
|
||||
return false;
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h
|
||||
index 0c16642..45b2632 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h
|
||||
@@ -108,8 +108,8 @@ class CDVDInputStreamNavigator
|
||||
int GetAudioStreamCount();
|
||||
bool SetActiveAudioStream(int iId);
|
||||
|
||||
- bool GetNavigatorState(std::string &xmlstate);
|
||||
- bool SetNavigatorState(std::string &xmlstate);
|
||||
+ bool GetState(std::string &xmlstate);
|
||||
+ bool SetState(const std::string &xmlstate);
|
||||
|
||||
int GetChapter() { return m_iPart; } // the current part in the current title
|
||||
int GetChapterCount() { return m_iPartCount; } // the number of parts in the current title
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
index 5baf57a..cb8a62b 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
@@ -936,16 +936,15 @@ void CDVDPlayer::Process()
|
||||
return;
|
||||
}
|
||||
|
||||
- if(m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
|
||||
+ if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream))
|
||||
{
|
||||
- CLog::Log(LOGNOTICE, "DVDPlayer: playing a dvd with menu's");
|
||||
+ CLog::Log(LOGNOTICE, "DVDPlayer: playing a file with menu's");
|
||||
m_PlayerOptions.starttime = 0;
|
||||
|
||||
-
|
||||
if(m_PlayerOptions.state.size() > 0)
|
||||
- ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(m_PlayerOptions.state);
|
||||
- else
|
||||
- ((CDVDInputStreamNavigator*)m_pInputStream)->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn);
|
||||
+ ptr->SetState(m_PlayerOptions.state);
|
||||
+ else if(CDVDInputStreamNavigator* nav = dynamic_cast<CDVDInputStreamNavigator*>(m_pInputStream))
|
||||
+ nav->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn);
|
||||
|
||||
g_settings.m_currentVideoSettings.m_SubtitleCached = true;
|
||||
}
|
||||
@@ -2147,13 +2146,14 @@ void CDVDPlayer::HandleMessages()
|
||||
|
||||
CDVDMsgPlayerSetState* pMsgPlayerSetState = (CDVDMsgPlayerSetState*)pMsg;
|
||||
|
||||
- if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
|
||||
+ if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream))
|
||||
{
|
||||
- std::string s = pMsgPlayerSetState->GetState();
|
||||
- ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(s);
|
||||
- m_dvd.state = DVDSTATE_NORMAL;
|
||||
- m_dvd.iDVDStillStartTime = 0;
|
||||
- m_dvd.iDVDStillTime = 0;
|
||||
+ if(ptr->SetState(pMsgPlayerSetState->GetState()))
|
||||
+ {
|
||||
+ m_dvd.state = DVDSTATE_NORMAL;
|
||||
+ m_dvd.iDVDStillStartTime = 0;
|
||||
+ m_dvd.iDVDStillTime = 0;
|
||||
+ }
|
||||
}
|
||||
|
||||
g_infoManager.SetDisplayAfterSeek();
|
||||
@@ -3853,9 +3853,12 @@ void CDVDPlayer::UpdatePlayState(double timeout)
|
||||
state.time_total = pDisplayTime->GetTotalTime();
|
||||
state.time_src = ETIMESOURCE_INPUT;
|
||||
}
|
||||
-
|
||||
- if (dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream))
|
||||
+
|
||||
+ if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream))
|
||||
{
|
||||
+ if(!ptr->GetState(state.player_state))
|
||||
+ state.player_state = "";
|
||||
+
|
||||
if(m_dvd.state == DVDSTATE_STILL)
|
||||
{
|
||||
state.time = XbmcThreads::SystemClockMillis() - m_dvd.iDVDStillStartTime;
|
||||
@@ -3880,13 +3883,6 @@ void CDVDPlayer::UpdatePlayState(double timeout)
|
||||
if(state.time_total <= 0)
|
||||
state.canseek = false;
|
||||
|
||||
- state.player_state = "";
|
||||
- if(CDVDInputStreamNavigator* ptr = dynamic_cast<CDVDInputStreamNavigator*>(m_pInputStream))
|
||||
- {
|
||||
- if(!ptr->GetNavigatorState(state.player_state))
|
||||
- state.player_state = "";
|
||||
- }
|
||||
-
|
||||
if (state.time_src == ETIMESOURCE_CLOCK)
|
||||
state.time_offset = m_offset_pts;
|
||||
else
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,456 +0,0 @@
|
||||
From 0c2eaf5082a30fb06bad553775e805a745d59ee2 Mon Sep 17 00:00:00 2001
|
||||
From: theuni <theuni-nospam@xbmc.org>
|
||||
Date: Tue, 22 Jan 2013 04:09:07 -0500
|
||||
Subject: [PATCH] depends: mark our wrapped functions as used
|
||||
|
||||
otherwise they get stripped when enabling dead code stripping
|
||||
---
|
||||
xbmc/cores/DllLoader/exports/wrapper.c | 138 ++++++++++++++++-----------------
|
||||
1 file changed, 69 insertions(+), 69 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
index cb7bbf7..67189e9 100644
|
||||
--- a/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
+++ b/xbmc/cores/DllLoader/exports/wrapper.c
|
||||
@@ -115,7 +115,7 @@
|
||||
int dll_setvbuf(FILE *stream, char *buf, int type, size_t size);
|
||||
struct mntent *dll_getmntent(FILE *fp);
|
||||
|
||||
-void *__wrap_dlopen(const char *filename, int flag)
|
||||
+__attribute__((used)) void *__wrap_dlopen(const char *filename, int flag)
|
||||
{
|
||||
#if defined(TARGET_ANDROID)
|
||||
return dll_dlopen(filename, flag);
|
||||
@@ -124,213 +124,213 @@ void *__wrap_dlopen(const char *filename, int flag)
|
||||
#endif
|
||||
}
|
||||
|
||||
-FILE *__wrap_popen(const char *command, const char *mode)
|
||||
+__attribute__((used)) FILE *__wrap_popen(const char *command, const char *mode)
|
||||
{
|
||||
return dll_popen(command, mode);
|
||||
}
|
||||
|
||||
-void* __wrap_calloc( size_t num, size_t size )
|
||||
+__attribute__((used)) void* __wrap_calloc( size_t num, size_t size )
|
||||
{
|
||||
return dllcalloc(num, size);
|
||||
}
|
||||
|
||||
-void* __wrap_malloc(size_t size)
|
||||
+__attribute__((used)) void* __wrap_malloc(size_t size)
|
||||
{
|
||||
return dllmalloc(size);
|
||||
}
|
||||
|
||||
-void* __wrap_realloc( void *memblock, size_t size )
|
||||
+__attribute__((used)) void* __wrap_realloc( void *memblock, size_t size )
|
||||
{
|
||||
return dllrealloc(memblock, size);
|
||||
}
|
||||
|
||||
-void __wrap_free( void* pPtr )
|
||||
+__attribute__((used)) void __wrap_free( void* pPtr )
|
||||
{
|
||||
dllfree(pPtr);
|
||||
}
|
||||
|
||||
-int __wrap_open(const char *file, int oflag, ...)
|
||||
+__attribute__((used)) int __wrap_open(const char *file, int oflag, ...)
|
||||
{
|
||||
return dll_open(file, oflag);
|
||||
}
|
||||
|
||||
-int __wrap_open64(const char *file, int oflag, ...)
|
||||
+__attribute__((used)) int __wrap_open64(const char *file, int oflag, ...)
|
||||
{
|
||||
return dll_open(file, oflag);
|
||||
}
|
||||
|
||||
-int __wrap_close(int fd)
|
||||
+__attribute__((used)) int __wrap_close(int fd)
|
||||
{
|
||||
return dll_close(fd);
|
||||
}
|
||||
|
||||
-ssize_t __wrap_write(int fd, const void *buf, size_t count)
|
||||
+__attribute__((used)) ssize_t __wrap_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
return dll_write(fd, buf, count);
|
||||
}
|
||||
|
||||
-ssize_t __wrap_read(int fd, void *buf, size_t count)
|
||||
+__attribute__((used)) ssize_t __wrap_read(int fd, void *buf, size_t count)
|
||||
{
|
||||
return dll_read(fd, buf, count);
|
||||
}
|
||||
|
||||
-__off_t __wrap_lseek(int fildes, __off_t offset, int whence)
|
||||
+__attribute__((used)) __off_t __wrap_lseek(int fildes, __off_t offset, int whence)
|
||||
{
|
||||
return dll_lseek(fildes, offset, whence);
|
||||
}
|
||||
|
||||
-__off64_t __wrap_lseek64(int fildes, __off64_t offset, int whence)
|
||||
+__attribute__((used)) __off64_t __wrap_lseek64(int fildes, __off64_t offset, int whence)
|
||||
{
|
||||
__off64_t seekRes = dll_lseeki64(fildes, offset, whence);
|
||||
return seekRes;
|
||||
}
|
||||
|
||||
-int __wrap_fclose(FILE *fp)
|
||||
+__attribute__((used)) int __wrap_fclose(FILE *fp)
|
||||
{
|
||||
return dll_fclose(fp);
|
||||
}
|
||||
|
||||
-int __wrap_ferror(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_ferror(FILE *stream)
|
||||
{
|
||||
return dll_ferror(stream);
|
||||
}
|
||||
|
||||
-void __wrap_clearerr(FILE *stream)
|
||||
+__attribute__((used)) void __wrap_clearerr(FILE *stream)
|
||||
{
|
||||
return dll_clearerr(stream);
|
||||
}
|
||||
|
||||
-int __wrap_feof(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_feof(FILE *stream)
|
||||
{
|
||||
return dll_feof(stream);
|
||||
}
|
||||
|
||||
-int __wrap_fileno(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_fileno(FILE *stream)
|
||||
{
|
||||
return dll_fileno(stream);
|
||||
}
|
||||
|
||||
-FILE *__wrap_fopen(const char *path, const char *mode)
|
||||
+__attribute__((used)) FILE *__wrap_fopen(const char *path, const char *mode)
|
||||
{
|
||||
return dll_fopen(path, mode);
|
||||
}
|
||||
|
||||
-FILE *__wrap_fopen64(const char *path, const char *mode)
|
||||
+__attribute__((used)) FILE *__wrap_fopen64(const char *path, const char *mode)
|
||||
{
|
||||
return dll_fopen(path, mode);
|
||||
}
|
||||
|
||||
-FILE *__wrap_fdopen(int fildes, const char *mode)
|
||||
+__attribute__((used)) FILE *__wrap_fdopen(int fildes, const char *mode)
|
||||
{
|
||||
return dll_fdopen(fildes, mode);
|
||||
}
|
||||
|
||||
-FILE *__wrap_freopen(const char *path, const char *mode, FILE *stream)
|
||||
+__attribute__((used)) FILE *__wrap_freopen(const char *path, const char *mode, FILE *stream)
|
||||
{
|
||||
return dll_freopen(path, mode, stream);
|
||||
}
|
||||
|
||||
-size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
+__attribute__((used)) size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
{
|
||||
return dll_fread(ptr, size, nmemb, stream);
|
||||
}
|
||||
|
||||
-size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
+__attribute__((used)) size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
{
|
||||
return dll_fwrite(ptr, size, nmemb, stream);
|
||||
}
|
||||
|
||||
-int __wrap_fflush(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_fflush(FILE *stream)
|
||||
{
|
||||
return dll_fflush(stream);
|
||||
}
|
||||
|
||||
-int __wrap_fputc(int c, FILE *stream)
|
||||
+__attribute__((used)) int __wrap_fputc(int c, FILE *stream)
|
||||
{
|
||||
return dll_fputc(c, stream);
|
||||
}
|
||||
|
||||
-int __wrap_fputs(const char *s, FILE *stream)
|
||||
+__attribute__((used)) int __wrap_fputs(const char *s, FILE *stream)
|
||||
{
|
||||
return dll_fputs(s, stream);
|
||||
}
|
||||
|
||||
-int __wrap__IO_putc(int c, FILE *stream)
|
||||
+__attribute__((used)) int __wrap__IO_putc(int c, FILE *stream)
|
||||
{
|
||||
return dll_putc(c, stream);
|
||||
}
|
||||
|
||||
-int __wrap_fseek(FILE *stream, long offset, int whence)
|
||||
+__attribute__((used)) int __wrap_fseek(FILE *stream, long offset, int whence)
|
||||
{
|
||||
return dll_fseek(stream, offset, whence);
|
||||
}
|
||||
|
||||
-int __wrap_fseeko64(FILE *stream, off64_t offset, int whence)
|
||||
+__attribute__((used)) int __wrap_fseeko64(FILE *stream, off64_t offset, int whence)
|
||||
{
|
||||
return dll_fseek64(stream, offset, whence);
|
||||
}
|
||||
|
||||
-long __wrap_ftell(FILE *stream)
|
||||
+__attribute__((used)) long __wrap_ftell(FILE *stream)
|
||||
{
|
||||
return dll_ftell(stream);
|
||||
}
|
||||
|
||||
-off64_t __wrap_ftello64(FILE *stream)
|
||||
+__attribute__((used)) off64_t __wrap_ftello64(FILE *stream)
|
||||
{
|
||||
return dll_ftell64(stream);
|
||||
}
|
||||
|
||||
-void __wrap_rewind(FILE *stream)
|
||||
+__attribute__((used)) void __wrap_rewind(FILE *stream)
|
||||
{
|
||||
dll_rewind(stream);
|
||||
}
|
||||
|
||||
-int __wrap_fgetpos(FILE *stream, fpos_t *pos)
|
||||
+__attribute__((used)) int __wrap_fgetpos(FILE *stream, fpos_t *pos)
|
||||
{
|
||||
return dll_fgetpos(stream, pos);
|
||||
}
|
||||
|
||||
-int __wrap_fgetpos64(FILE *stream, fpos64_t *pos)
|
||||
+__attribute__((used)) int __wrap_fgetpos64(FILE *stream, fpos64_t *pos)
|
||||
{
|
||||
return dll_fgetpos64(stream, pos);
|
||||
}
|
||||
|
||||
-int __wrap_fsetpos(FILE *stream, fpos_t *pos)
|
||||
+__attribute__((used)) int __wrap_fsetpos(FILE *stream, fpos_t *pos)
|
||||
{
|
||||
return dll_fsetpos(stream, pos);
|
||||
}
|
||||
|
||||
-int __wrap_fsetpos64(FILE *stream, fpos64_t *pos)
|
||||
+__attribute__((used)) int __wrap_fsetpos64(FILE *stream, fpos64_t *pos)
|
||||
{
|
||||
return dll_fsetpos64(stream, pos);
|
||||
}
|
||||
|
||||
-DIR * __wrap_opendir(const char *name)
|
||||
+__attribute__((used)) DIR * __wrap_opendir(const char *name)
|
||||
{
|
||||
return dll_opendir(name);
|
||||
}
|
||||
|
||||
-struct dirent * __wrap_readdir(DIR* dirp)
|
||||
+__attribute__((used)) struct dirent * __wrap_readdir(DIR* dirp)
|
||||
{
|
||||
return dll_readdir(dirp);
|
||||
}
|
||||
|
||||
-struct dirent * __wrap_readdir64(DIR* dirp)
|
||||
+__attribute__((used)) struct dirent * __wrap_readdir64(DIR* dirp)
|
||||
{
|
||||
return dll_readdir(dirp);
|
||||
}
|
||||
|
||||
-int __wrap_closedir(DIR* dirp)
|
||||
+__attribute__((used)) int __wrap_closedir(DIR* dirp)
|
||||
{
|
||||
return dll_closedir(dirp);
|
||||
}
|
||||
|
||||
-void __wrap_rewinddir(DIR* dirp)
|
||||
+__attribute__((used)) void __wrap_rewinddir(DIR* dirp)
|
||||
{
|
||||
dll_rewinddir(dirp);
|
||||
}
|
||||
|
||||
-int __wrap_fprintf(FILE *stream, const char *format, ...)
|
||||
+__attribute__((used)) int __wrap_fprintf(FILE *stream, const char *format, ...)
|
||||
{
|
||||
int res;
|
||||
va_list va;
|
||||
@@ -340,12 +340,12 @@ int __wrap_fprintf(FILE *stream, const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-int __wrap_vfprintf(FILE *stream, const char *format, va_list ap)
|
||||
+__attribute__((used)) int __wrap_vfprintf(FILE *stream, const char *format, va_list ap)
|
||||
{
|
||||
return dll_vfprintf(stream, format, ap);
|
||||
}
|
||||
|
||||
-int __wrap_printf(const char *format, ...)
|
||||
+__attribute__((used)) int __wrap_printf(const char *format, ...)
|
||||
{
|
||||
int res;
|
||||
va_list va;
|
||||
@@ -355,42 +355,42 @@ int __wrap_printf(const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-int __wrap_fgetc(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_fgetc(FILE *stream)
|
||||
{
|
||||
return dll_fgetc(stream);
|
||||
}
|
||||
|
||||
-char *__wrap_fgets(char *s, int size, FILE *stream)
|
||||
+__attribute__((used)) char *__wrap_fgets(char *s, int size, FILE *stream)
|
||||
{
|
||||
return dll_fgets(s, size, stream);
|
||||
}
|
||||
|
||||
-int __wrap__IO_getc(FILE *stream)
|
||||
+__attribute__((used)) int __wrap__IO_getc(FILE *stream)
|
||||
{
|
||||
return dll_getc(stream);
|
||||
}
|
||||
|
||||
-int __wrap__IO_getc_unlocked(FILE *stream)
|
||||
+__attribute__((used)) int __wrap__IO_getc_unlocked(FILE *stream)
|
||||
{
|
||||
return dll_getc(stream);
|
||||
}
|
||||
|
||||
-int __wrap_getc_unlocked(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_getc_unlocked(FILE *stream)
|
||||
{
|
||||
return dll_getc(stream);
|
||||
}
|
||||
|
||||
-int __wrap_ungetc(int c, FILE *stream)
|
||||
+__attribute__((used)) int __wrap_ungetc(int c, FILE *stream)
|
||||
{
|
||||
return dll_ungetc(c, stream);
|
||||
}
|
||||
|
||||
-int __wrap_getc(FILE *stream)
|
||||
+__attribute__((used)) int __wrap_getc(FILE *stream)
|
||||
{
|
||||
return dll_getc(stream);
|
||||
}
|
||||
|
||||
-int __wrap_ioctl(int d, unsigned long int request, ...)
|
||||
+__attribute__((used)) int __wrap_ioctl(int d, unsigned long int request, ...)
|
||||
{
|
||||
int res;
|
||||
va_list va;
|
||||
@@ -400,52 +400,52 @@ int __wrap_ioctl(int d, unsigned long int request, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-int __wrap__stat(const char *path, struct _stat *buffer)
|
||||
+__attribute__((used)) int __wrap__stat(const char *path, struct _stat *buffer)
|
||||
{
|
||||
return dll_stat(path, buffer);
|
||||
}
|
||||
|
||||
-int __wrap___xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
|
||||
+__attribute__((used)) int __wrap___xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
|
||||
{
|
||||
return dll_stat64(__filename, __stat_buf);
|
||||
}
|
||||
|
||||
-int __wrap___lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
|
||||
+__attribute__((used)) int __wrap___lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
|
||||
{
|
||||
return dll_stat64(__filename, __stat_buf);
|
||||
}
|
||||
|
||||
-void __wrap_flockfile(FILE *file)
|
||||
+__attribute__((used)) void __wrap_flockfile(FILE *file)
|
||||
{
|
||||
dll_flockfile(file);
|
||||
}
|
||||
|
||||
-int __wrap_ftrylockfile(FILE *file)
|
||||
+__attribute__((used)) int __wrap_ftrylockfile(FILE *file)
|
||||
{
|
||||
return dll_ftrylockfile(file);
|
||||
}
|
||||
|
||||
-void __wrap_funlockfile(FILE *file)
|
||||
+__attribute__((used)) void __wrap_funlockfile(FILE *file)
|
||||
{
|
||||
dll_funlockfile(file);
|
||||
}
|
||||
|
||||
-int __wrap___fxstat64(int ver, int fd, struct stat64 *buf)
|
||||
+__attribute__((used)) int __wrap___fxstat64(int ver, int fd, struct stat64 *buf)
|
||||
{
|
||||
return dll_fstat64(fd, buf);
|
||||
}
|
||||
|
||||
-int __wrap_fstat(int fd, struct _stat *buf)
|
||||
+__attribute__((used)) int __wrap_fstat(int fd, struct _stat *buf)
|
||||
{
|
||||
return dll_fstat(fd, buf);
|
||||
}
|
||||
|
||||
-int __wrap_setvbuf(FILE *stream, char *buf, int type, size_t size)
|
||||
+__attribute__((used)) int __wrap_setvbuf(FILE *stream, char *buf, int type, size_t size)
|
||||
{
|
||||
return dll_setvbuf(stream, buf, type, size);
|
||||
}
|
||||
|
||||
-struct mntent *__wrap_getmntent(FILE *fp)
|
||||
+__attribute__((used)) struct mntent *__wrap_getmntent(FILE *fp)
|
||||
{
|
||||
#ifdef _LINUX
|
||||
return dll_getmntent(fp);
|
||||
@@ -459,12 +459,12 @@ struct mntent *__wrap_getmntent(FILE *fp)
|
||||
// thing to actually call our wrapped functions.
|
||||
#if _FORTIFY_SOURCE > 1
|
||||
|
||||
-size_t __wrap___fread_chk(void * ptr, size_t ptrlen, size_t size, size_t n, FILE * stream)
|
||||
+__attribute__((used)) size_t __wrap___fread_chk(void * ptr, size_t ptrlen, size_t size, size_t n, FILE * stream)
|
||||
{
|
||||
return dll_fread(ptr, size, n, stream);
|
||||
}
|
||||
|
||||
-int __wrap___printf_chk(int flag, const char *format, ...)
|
||||
+__attribute__((used)) int __wrap___printf_chk(int flag, const char *format, ...)
|
||||
{
|
||||
int res;
|
||||
va_list va;
|
||||
@@ -474,12 +474,12 @@ int __wrap___printf_chk(int flag, const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, _G_va_list ap)
|
||||
+__attribute__((used)) int __wrap___vfprintf_chk(FILE* stream, int flag, const char *format, _G_va_list ap)
|
||||
{
|
||||
return dll_vfprintf(stream, format, ap);
|
||||
}
|
||||
|
||||
-int __wrap___fprintf_chk(FILE * stream, int flag, const char *format, ...)
|
||||
+__attribute__((used)) int __wrap___fprintf_chk(FILE * stream, int flag, const char *format, ...)
|
||||
{
|
||||
int res;
|
||||
va_list va;
|
||||
@@ -489,12 +489,12 @@ int __wrap___fprintf_chk(FILE * stream, int flag, const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
-char *__wrap___fgets_chk(char *s, size_t size, int n, FILE *stream)
|
||||
+__attribute__((used)) char *__wrap___fgets_chk(char *s, size_t size, int n, FILE *stream)
|
||||
{
|
||||
return dll_fgets(s, n, stream);
|
||||
}
|
||||
|
||||
-size_t __wrap___read_chk(int fd, void *buf, size_t nbytes, size_t buflen)
|
||||
+__attribute__((used)) size_t __wrap___read_chk(int fd, void *buf, size_t nbytes, size_t buflen)
|
||||
{
|
||||
return dll_read(fd, buf, nbytes);
|
||||
}
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 822abd913ab38a742f710173f551bac22477eebd Mon Sep 17 00:00:00 2001
|
||||
From: Lee Pollock <scudlee@gmail.com>
|
||||
Date: Wed, 8 May 2013 18:04:41 +0100
|
||||
Subject: [PATCH] [Fix] Re-get details from nfo file after advancing to first
|
||||
episodedetails
|
||||
|
||||
---
|
||||
xbmc/NfoFile.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/xbmc/NfoFile.cpp b/xbmc/NfoFile.cpp
|
||||
index 973e4d0..791c92e 100644
|
||||
--- a/xbmc/NfoFile.cpp
|
||||
+++ b/xbmc/NfoFile.cpp
|
||||
@@ -71,6 +71,7 @@
|
||||
{
|
||||
int infos=0;
|
||||
m_headofdoc = strstr(m_headofdoc,"<episodedetails");
|
||||
+ bNfo = GetDetails(details);
|
||||
while (m_headofdoc && details.m_iEpisode != episode)
|
||||
{
|
||||
m_headofdoc = strstr(m_headofdoc+1,"<episodedetails");
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 67fbfc5c5ed4f8186451a9f970c82a10b545d71c Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Sat, 11 May 2013 06:03:55 +0800
|
||||
Subject: [PATCH] Fix color index overflow by reuse existed color in the
|
||||
vector. Fix #14293
|
||||
|
||||
---
|
||||
xbmc/guilib/GUITextLayout.cpp | 19 ++++++++++++++++---
|
||||
1 file changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/xbmc/guilib/GUITextLayout.cpp b/xbmc/guilib/GUITextLayout.cpp
|
||||
index 33c8c48..8dc8b45 100644
|
||||
--- a/xbmc/guilib/GUITextLayout.cpp
|
||||
+++ b/xbmc/guilib/GUITextLayout.cpp
|
||||
@@ -401,9 +401,22 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
|
||||
{ // color
|
||||
size_t finish = text.Find(L']', pos + 5);
|
||||
if (on && finish != CStdString::npos && (size_t)text.Find(L"[/COLOR]",finish) != CStdString::npos)
|
||||
- { // create new color
|
||||
- newColor = colors.size();
|
||||
- colors.push_back(g_colorManager.GetColor(text.Mid(pos + 5, finish - pos - 5)));
|
||||
+ {
|
||||
+ color_t color = g_colorManager.GetColor(text.Mid(pos + 5, finish - pos - 5));
|
||||
+ vecColors::const_iterator it = std::find(colors.begin(), colors.end(), color);
|
||||
+ if (it == colors.end())
|
||||
+ { // create new color
|
||||
+ if (colors.size() <= 0xFF)
|
||||
+ {
|
||||
+ newColor = colors.size();
|
||||
+ colors.push_back(color);
|
||||
+ }
|
||||
+ else // we have only 8 bits for color index, fallback to first color if reach max.
|
||||
+ newColor = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ // reuse existing color
|
||||
+ newColor = it - colors.begin();
|
||||
colorStack.push(newColor);
|
||||
}
|
||||
else if (!on && finish == pos + 5 && colorStack.size() > 1)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,41 +0,0 @@
|
||||
From ef82d9b6177a0576548e8e9cdc0eb17cf10524af Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Thu, 9 May 2013 13:11:59 +0800
|
||||
Subject: [PATCH] [OSX] Fix always on top after restore from fullscreen.
|
||||
|
||||
---
|
||||
xbmc/windowing/osx/WinSystemOSX.mm | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
|
||||
index e45693c..cb86e0a 100644
|
||||
--- a/xbmc/windowing/osx/WinSystemOSX.mm
|
||||
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
|
||||
@@ -710,6 +710,7 @@ static void DisplayReconfigured(CGDirectDisplayID display,
|
||||
static NSView* last_view = NULL;
|
||||
static NSSize last_view_size;
|
||||
static NSPoint last_view_origin;
|
||||
+ static NSInteger last_window_level = NSNormalWindowLevel;
|
||||
bool was_fullscreen = m_bFullScreen;
|
||||
static int lastDisplayNr = res.iScreen;
|
||||
NSOpenGLContext* cur_context;
|
||||
@@ -779,6 +780,7 @@ static void DisplayReconfigured(CGDirectDisplayID display,
|
||||
last_view_origin = [last_view frame].origin;
|
||||
last_window_screen = [[last_view window] screen];
|
||||
last_window_origin = [[last_view window] frame].origin;
|
||||
+ last_window_level = [[last_view window] level];
|
||||
|
||||
if (CSettings::Get().GetBool("videoscreen.fakefullscreen"))
|
||||
{
|
||||
@@ -891,7 +893,7 @@ static void DisplayReconfigured(CGDirectDisplayID display,
|
||||
if (CSettings::Get().GetBool("videoscreen.fakefullscreen"))
|
||||
{
|
||||
// restore the windowed window level
|
||||
- [[last_view window] setLevel:NSNormalWindowLevel];
|
||||
+ [[last_view window] setLevel:last_window_level];
|
||||
|
||||
// Get rid of the new window we created.
|
||||
if (windowedFullScreenwindow != NULL)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 07c1ed5752225f44a55ed9099c5cbfd34bff0906 Mon Sep 17 00:00:00 2001
|
||||
From: Ulion <ulion2002@gmail.com>
|
||||
Date: Mon, 29 Apr 2013 06:09:14 +0800
|
||||
Subject: [PATCH] Fix undefined reference caused by wrong detection of gcc
|
||||
builtin atomic functions.
|
||||
|
||||
---
|
||||
configure.in | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index f0e4905..95f12da 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -850,7 +850,7 @@ AC_CHECK_SIZEOF([size_t])
|
||||
|
||||
# Check for intrinsics
|
||||
AC_MSG_CHECKING([for __sync_add_and_fetch(temp, 1)])
|
||||
-AC_TRY_COMPILE([],[long* temp=0; __sync_add_and_fetch(temp, 1);],
|
||||
+AC_TRY_LINK([],[long* temp=0; long ret=__sync_add_and_fetch(temp, 1);],
|
||||
[have_builtin_sync_add_and_fetch=yes],
|
||||
[have_builtin_sync_add_and_fetch=no])
|
||||
AC_MSG_RESULT($have_builtin_sync_add_and_fetch)
|
||||
@@ -860,7 +860,7 @@ if test "x$have_builtin_sync_add_and_fetch" = "xyes"; then
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for __sync_sub_and_fetch(temp, 1)])
|
||||
-AC_TRY_COMPILE([],[long* temp=0; __sync_sub_and_fetch(temp, 1);],
|
||||
+AC_TRY_LINK([],[long* temp=0; long ret=__sync_sub_and_fetch(temp, 1);],
|
||||
[have_builtin_sync_sub_and_fetch=yes],
|
||||
[have_builtin_sync_sub_and_fetch=no])
|
||||
AC_MSG_RESULT($have_builtin_sync_sub_and_fetch)
|
||||
@@ -870,7 +870,7 @@ if test "x$have_builtin_sync_sub_and_fetch" = "xyes"; then
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for __sync_val_compare_and_swap(temp, 1, 1)])
|
||||
-AC_TRY_COMPILE([],[long *temp = 0; __sync_val_compare_and_swap(temp, 1, 1);],
|
||||
+AC_TRY_LINK([],[long *temp = 0; long ret=__sync_val_compare_and_swap(temp, 1, 1);],
|
||||
[have_builtin_sync_val_compare_and_swap=yes],
|
||||
[have_builtin_sync_val_compare_and_swap=no])
|
||||
AC_MSG_RESULT($have_builtin_sync_val_compare_and_swap)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 01480bb7ab2022616c938d2fd222cfdafa243b67 Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Wed, 10 Apr 2013 19:54:54 +0800
|
||||
Subject: [PATCH] avoid detect folder.jpg under 'add' item.
|
||||
|
||||
---
|
||||
xbmc/pictures/PictureThumbLoader.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/pictures/PictureThumbLoader.cpp b/xbmc/pictures/PictureThumbLoader.cpp
|
||||
index ddff86c..61c624d 100644
|
||||
--- a/xbmc/pictures/PictureThumbLoader.cpp
|
||||
+++ b/xbmc/pictures/PictureThumbLoader.cpp
|
||||
@@ -132,7 +132,8 @@ void CPictureThumbLoader::ProcessFoldersAndArchives(CFileItem *pItem)
|
||||
return;
|
||||
}
|
||||
}
|
||||
- if ((pItem->m_bIsFolder || pItem->IsCBR() || pItem->IsCBZ()) && !pItem->m_bIsShareOrDrive && !pItem->IsParentFolder())
|
||||
+ if ((pItem->m_bIsFolder || pItem->IsCBR() || pItem->IsCBZ()) && !pItem->m_bIsShareOrDrive
|
||||
+ && !pItem->IsParentFolder() && !pItem->GetPath().Equals("add"))
|
||||
{
|
||||
// first check for a folder.jpg
|
||||
CStdString thumb = "folder.jpg";
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,29 +0,0 @@
|
||||
From ff283b0861afd35410d20c52fee8ba0542e91f8a Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Sun, 24 Mar 2013 13:19:39 +0800
|
||||
Subject: [PATCH] Check exists before listing dir, to avoid produce error log,
|
||||
fix #14210
|
||||
|
||||
---
|
||||
xbmc/video/VideoInfoScanner.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp
|
||||
index 170b5a9..fbe7913 100644
|
||||
--- a/xbmc/video/VideoInfoScanner.cpp
|
||||
+++ b/xbmc/video/VideoInfoScanner.cpp
|
||||
@@ -1771,7 +1771,10 @@
|
||||
void CVideoInfoScanner::FetchActorThumbs(vector<SActorInfo>& actors, const CStdString& strPath)
|
||||
{
|
||||
CFileItemList items;
|
||||
- CDirectory::GetDirectory(URIUtils::AddFileToFolder(strPath, ".actors"), items, ".png|.jpg|.tbn", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_NO_FILE_INFO);
|
||||
+ CStdString actorsDir = URIUtils::AddFileToFolder(strPath, ".actors");
|
||||
+ if (CDirectory::Exists(actorsDir))
|
||||
+ CDirectory::GetDirectory(actorsDir, items, ".png|.jpg|.tbn", DIR_FLAG_NO_FILE_DIRS |
|
||||
+ DIR_FLAG_NO_FILE_INFO);
|
||||
for (vector<SActorInfo>::iterator i = actors.begin(); i != actors.end(); ++i)
|
||||
{
|
||||
if (i->thumb.IsEmpty())
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,45 +0,0 @@
|
||||
From 937e565410c19c0c3c3651c467c919a69cf027a2 Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Mon, 13 May 2013 08:41:14 +0800
|
||||
Subject: [PATCH] Fix color tag didn't hide bug introduced by PR2725.
|
||||
|
||||
---
|
||||
xbmc/guilib/GUITextLayout.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/guilib/GUITextLayout.cpp b/xbmc/guilib/GUITextLayout.cpp
|
||||
index 8dc8b45..49c0459 100644
|
||||
--- a/xbmc/guilib/GUITextLayout.cpp
|
||||
+++ b/xbmc/guilib/GUITextLayout.cpp
|
||||
@@ -354,6 +354,7 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
|
||||
{
|
||||
uint32_t newStyle = 0;
|
||||
color_t newColor = currentColor;
|
||||
+ bool colorTagChange = false;
|
||||
bool newLine = false;
|
||||
// have a [ - check if it's an ON or OFF switch
|
||||
bool on(true);
|
||||
@@ -418,17 +419,19 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
|
||||
// reuse existing color
|
||||
newColor = it - colors.begin();
|
||||
colorStack.push(newColor);
|
||||
+ colorTagChange = true;
|
||||
}
|
||||
else if (!on && finish == pos + 5 && colorStack.size() > 1)
|
||||
{ // revert to previous color
|
||||
colorStack.pop();
|
||||
newColor = colorStack.top();
|
||||
+ colorTagChange = true;
|
||||
}
|
||||
if (finish != CStdString::npos)
|
||||
pos = finish + 1;
|
||||
}
|
||||
|
||||
- if (newStyle || newColor != currentColor || newLine)
|
||||
+ if (newStyle || colorTagChange || newLine)
|
||||
{ // we have a new style or a new color, so format up the previous segment
|
||||
CStdStringW subText = text.Mid(startPos, endPos - startPos);
|
||||
if (currentStyle & FONT_STYLE_UPPERCASE)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 2441ddbbd638fb8b81c0eed46a78ba1a1b228413 Mon Sep 17 00:00:00 2001
|
||||
From: Rainer Hochecker <fernetmenta@online.de>
|
||||
Date: Fri, 17 May 2013 09:19:16 +0200
|
||||
Subject: [PATCH] backport some constructor initializations from
|
||||
92e8bc4a4361d730abac9ad3080cd6923e9d551a
|
||||
|
||||
---
|
||||
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
|
||||
index f70a4f9..5af76d0 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
|
||||
@@ -147,6 +147,10 @@
|
||||
dl_vdp_device_create_x11 = NULL;
|
||||
dl_vdp_get_proc_address = NULL;
|
||||
dl_vdp_preemption_callback_register = NULL;
|
||||
+ past[0] = NULL;
|
||||
+ past[1] = NULL;
|
||||
+ current = NULL;
|
||||
+ future = NULL;
|
||||
}
|
||||
|
||||
bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,85 +0,0 @@
|
||||
From 6cba369a0f54231b145ce6b07a42cd1cd32261ec Mon Sep 17 00:00:00 2001
|
||||
From: ulion <ulion2002@gmail.com>
|
||||
Date: Sun, 21 Apr 2013 04:43:30 +0800
|
||||
Subject: [PATCH] Fixed: do not send Range request header when encounter error.
|
||||
|
||||
---
|
||||
xbmc/filesystem/CurlFile.cpp | 20 +++++++++++++++++++-
|
||||
xbmc/filesystem/CurlFile.h | 1 +
|
||||
2 files changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp
|
||||
index ff8250c..8667fc6 100644
|
||||
--- a/xbmc/filesystem/CurlFile.cpp
|
||||
+++ b/xbmc/filesystem/CurlFile.cpp
|
||||
@@ -197,6 +197,7 @@ size_t CCurlFile::CReadState::WriteCallback(char *buffer, size_t size, size_t ni
|
||||
m_bufferSize = 0;
|
||||
m_cancelled = false;
|
||||
m_bFirstLoop = true;
|
||||
+ m_sendRange = true;
|
||||
m_headerdone = false;
|
||||
}
|
||||
|
||||
@@ -255,8 +256,13 @@ void CCurlFile::CReadState::SetResume(void)
|
||||
* request header. If we don't the server may provide different content causing seeking to fail.
|
||||
* This only affects HTTP-like items, for FTP it's a null operation.
|
||||
*/
|
||||
- if (m_filePos == 0)
|
||||
+ if (m_sendRange && m_filePos == 0)
|
||||
g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RANGE, "0-");
|
||||
+ else
|
||||
+ {
|
||||
+ g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RANGE, NULL);
|
||||
+ m_sendRange = false;
|
||||
+ }
|
||||
|
||||
g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RESUME_FROM_LARGE, m_filePos);
|
||||
}
|
||||
@@ -866,6 +872,7 @@ bool CCurlFile::Open(const CURL& url)
|
||||
// setup common curl options
|
||||
SetCommonOptions(m_state);
|
||||
SetRequestHeaders(m_state);
|
||||
+ m_state->m_sendRange = m_seekable;
|
||||
|
||||
m_httpresponse = m_state->Connect(m_bufferSize);
|
||||
if( m_httpresponse < 0 || m_httpresponse >= 400)
|
||||
@@ -1046,6 +1053,7 @@ int64_t CCurlFile::Seek(int64_t iFilePosition, int iWhence)
|
||||
SetRequestHeaders(m_state);
|
||||
|
||||
m_state->m_filePos = nextPos;
|
||||
+ m_state->m_sendRange = true;
|
||||
if (oldstate)
|
||||
m_state->m_fileSize = oldstate->m_fileSize;
|
||||
|
||||
@@ -1287,6 +1295,16 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want)
|
||||
msg->data.result == CURLE_RECV_ERROR) &&
|
||||
!m_bFirstLoop)
|
||||
CURLresult = msg->data.result;
|
||||
+ else if ( (msg->data.result == CURLE_HTTP_RANGE_ERROR ||
|
||||
+ msg->data.result == CURLE_HTTP_RETURNED_ERROR) &&
|
||||
+ m_bFirstLoop &&
|
||||
+ m_filePos == 0 &&
|
||||
+ m_sendRange)
|
||||
+ {
|
||||
+ // If server returns a range or http error, retry with range disabled
|
||||
+ CURLresult = msg->data.result;
|
||||
+ m_sendRange = false;
|
||||
+ }
|
||||
else
|
||||
return false;
|
||||
}
|
||||
diff --git a/xbmc/filesystem/CurlFile.h b/xbmc/filesystem/CurlFile.h
|
||||
index d25fb58..a48207a 100644
|
||||
--- a/xbmc/filesystem/CurlFile.h
|
||||
+++ b/xbmc/filesystem/CurlFile.h
|
||||
@@ -101,6 +101,7 @@
|
||||
int64_t m_fileSize;
|
||||
int64_t m_filePos;
|
||||
bool m_bFirstLoop;
|
||||
+ bool m_sendRange;
|
||||
|
||||
/* returned http header */
|
||||
CHttpHeader m_httpheader;
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 812a89032539d7d40d8d27b10337c1dd2ccca29b Mon Sep 17 00:00:00 2001
|
||||
From: montellese <montellese@xbmc.org>
|
||||
Date: Sun, 19 May 2013 15:46:05 +0200
|
||||
Subject: [PATCH] CGUISliderControl: only switch between selectors on <Enter>
|
||||
if there are more than one
|
||||
|
||||
---
|
||||
xbmc/guilib/GUISliderControl.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/guilib/GUISliderControl.cpp b/xbmc/guilib/GUISliderControl.cpp
|
||||
index 9de3413..5cce7a8 100644
|
||||
--- a/xbmc/guilib/GUISliderControl.cpp
|
||||
+++ b/xbmc/guilib/GUISliderControl.cpp
|
||||
@@ -174,7 +174,8 @@ bool CGUISliderControl::OnAction(const CAction &action)
|
||||
|
||||
case ACTION_SELECT_ITEM:
|
||||
// switch between the two sliders
|
||||
- SwitchRangeSelector();
|
||||
+ if (m_rangeSelection)
|
||||
+ SwitchRangeSelector();
|
||||
return true;
|
||||
|
||||
default:
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 2e18d8108e29d58199616d7d6457026ef736cf47 Mon Sep 17 00:00:00 2001
|
||||
From: Rainer Hochecker <fernetmenta@online.de>
|
||||
Date: Fri, 17 May 2013 09:07:27 +0200
|
||||
Subject: [PATCH] pvr: fix channel switch for addons using other stream
|
||||
|
||||
---
|
||||
xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
|
||||
index aa3298b..397ea5d 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp
|
||||
@@ -315,8 +315,9 @@ bool CDVDInputStreamPVRManager::UpdateItem(CFileItem& item)
|
||||
|
||||
m_eof = IsEOF();
|
||||
|
||||
- if (m_pOtherStream)
|
||||
- return m_pOtherStream->NextStream();
|
||||
+ CDVDInputStream::ENextStream next;
|
||||
+ if (m_pOtherStream && ((next = m_pOtherStream->NextStream()) != NEXTSTREAM_NONE))
|
||||
+ return next;
|
||||
else if(m_pFile->SkipNext())
|
||||
{
|
||||
if (m_eof)
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,300 +0,0 @@
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerAudio.cpp xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerAudio.cpp 2013-05-02 17:00:07.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerAudio.cpp 2013-06-12 23:56:33.134924673 +0200
|
||||
@@ -76,7 +76,6 @@
|
||||
m_buffer_empty = false;
|
||||
m_nChannels = 0;
|
||||
m_DecoderOpen = false;
|
||||
- m_freq = CurrentHostFrequency();
|
||||
m_bad_state = false;
|
||||
m_hints_current.Clear();
|
||||
|
||||
@@ -135,20 +134,11 @@
|
||||
|
||||
m_speed = DVD_PLAYSPEED_NORMAL;
|
||||
m_audioClock = 0;
|
||||
- m_error = 0;
|
||||
- m_errorbuff = 0;
|
||||
- m_errorcount = 0;
|
||||
- m_integral = 0;
|
||||
- m_skipdupcount = 0;
|
||||
- m_prevskipped = false;
|
||||
- m_syncclock = true;
|
||||
m_hw_decode = false;
|
||||
- m_errortime = CurrentHostCounter();
|
||||
m_silence = false;
|
||||
m_started = false;
|
||||
m_flush = false;
|
||||
m_nChannels = 0;
|
||||
- m_synctype = SYNC_DISCON;
|
||||
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
|
||||
m_use_passthrough = (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI) ? true : false ;
|
||||
m_use_hw_decode = g_advancedSettings.m_omxHWAudioDecode;
|
||||
@@ -190,110 +180,6 @@
|
||||
CLog::Log(LOGNOTICE, "thread end: OMXPlayerAudio::OnExit()");
|
||||
}
|
||||
|
||||
-
|
||||
-
|
||||
-void OMXPlayerAudio::HandleSyncError(double duration)
|
||||
-{
|
||||
- double clock = m_av_clock->GetClock();
|
||||
- double error = m_audioClock - clock;
|
||||
- int64_t now;
|
||||
-
|
||||
- if( fabs(error) > DVD_MSEC_TO_TIME(100) || m_syncclock )
|
||||
- {
|
||||
- m_av_clock->Discontinuity(clock+error);
|
||||
- /*
|
||||
- if(m_speed == DVD_PLAYSPEED_NORMAL)
|
||||
- CLog::Log(LOGDEBUG, "OMXPlayerAudio:: Discontinuity - was:%f, should be:%f, error:%f\n", clock, clock+error, error);
|
||||
- */
|
||||
-
|
||||
- m_errorbuff = 0;
|
||||
- m_errorcount = 0;
|
||||
- m_skipdupcount = 0;
|
||||
- m_error = 0;
|
||||
- m_syncclock = false;
|
||||
- m_errortime = CurrentHostCounter();
|
||||
-
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (m_speed != DVD_PLAYSPEED_NORMAL)
|
||||
- {
|
||||
- m_errorbuff = 0;
|
||||
- m_errorcount = 0;
|
||||
- m_integral = 0;
|
||||
- m_skipdupcount = 0;
|
||||
- m_error = 0;
|
||||
- m_errortime = CurrentHostCounter();
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- //check if measured error for 1 second
|
||||
- now = CurrentHostCounter();
|
||||
- if ((now - m_errortime) >= m_freq)
|
||||
- {
|
||||
- m_errortime = now;
|
||||
- m_error = m_errorbuff / m_errorcount;
|
||||
-
|
||||
- m_errorbuff = 0;
|
||||
- m_errorcount = 0;
|
||||
-
|
||||
- if (m_synctype == SYNC_DISCON)
|
||||
- {
|
||||
- double limit, error;
|
||||
-
|
||||
- if (m_av_clock->GetRefreshRate(&limit) > 0)
|
||||
- {
|
||||
- //when the videoreferenceclock is running, the discontinuity limit is one vblank period
|
||||
- limit *= DVD_TIME_BASE;
|
||||
-
|
||||
- //make error a multiple of limit, rounded towards zero,
|
||||
- //so it won't interfere with the sync methods in CXBMCRenderManager::WaitPresentTime
|
||||
- if (m_error > 0.0)
|
||||
- error = limit * floor(m_error / limit);
|
||||
- else
|
||||
- error = limit * ceil(m_error / limit);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- limit = DVD_MSEC_TO_TIME(10);
|
||||
- error = m_error;
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- limit = DVD_MSEC_TO_TIME(10);
|
||||
- error = m_error;
|
||||
- */
|
||||
-
|
||||
- if (fabs(error) > limit - 0.001)
|
||||
- {
|
||||
- m_av_clock->Discontinuity(clock+error);
|
||||
- /*
|
||||
- if(m_speed == DVD_PLAYSPEED_NORMAL)
|
||||
- CLog::Log(LOGDEBUG, "COMXPlayerAudio:: Discontinuity - was:%f, should be:%f, error:%f", clock, clock+error, error);
|
||||
- */
|
||||
- }
|
||||
- }
|
||||
- /*
|
||||
- else if (m_synctype == SYNC_SKIPDUP && m_skipdupcount == 0 && fabs(m_error) > DVD_MSEC_TO_TIME(10))
|
||||
- if (m_skipdupcount == 0 && fabs(m_error) > DVD_MSEC_TO_TIME(10))
|
||||
- {
|
||||
- //check how many packets to skip/duplicate
|
||||
- m_skipdupcount = (int)(m_error / duration);
|
||||
- //if less than one frame off, see if it's more than two thirds of a frame, so we can get better in sync
|
||||
- if (m_skipdupcount == 0 && fabs(m_error) > duration / 3 * 2)
|
||||
- m_skipdupcount = (int)(m_error / (duration / 3 * 2));
|
||||
-
|
||||
- if (m_skipdupcount > 0)
|
||||
- CLog::Log(LOGDEBUG, "OMXPlayerAudio:: Duplicating %i packet(s) of %.2f ms duration",
|
||||
- m_skipdupcount, duration / DVD_TIME_BASE * 1000.0);
|
||||
- else if (m_skipdupcount < 0)
|
||||
- CLog::Log(LOGDEBUG, "OMXPlayerAudio:: Skipping %i packet(s) of %.2f ms duration ",
|
||||
- m_skipdupcount * -1, duration / DVD_TIME_BASE * 1000.0);
|
||||
- }
|
||||
- */
|
||||
- }
|
||||
-}
|
||||
-
|
||||
bool OMXPlayerAudio::CodecChange()
|
||||
{
|
||||
unsigned int old_bitrate = m_hints.bitrate;
|
||||
@@ -394,9 +280,6 @@
|
||||
int n = (m_nChannels * m_hints.bitspersample * m_hints.samplerate)>>3;
|
||||
if (n > 0)
|
||||
m_audioClock += ((double)decoded_size * DVD_TIME_BASE) / n;
|
||||
-
|
||||
- if(m_speed == DVD_PLAYSPEED_NORMAL)
|
||||
- HandleSyncError((((double)decoded_size * DVD_TIME_BASE) / n));
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -430,9 +313,6 @@
|
||||
m_omxAudio.AddPackets(pkt->pData, pkt->iSize, m_audioClock, m_audioClock);
|
||||
}
|
||||
|
||||
- if(m_speed == DVD_PLAYSPEED_NORMAL)
|
||||
- HandleSyncError(0);
|
||||
-
|
||||
m_audioStats.AddSampleBytes(pkt->iSize);
|
||||
|
||||
break;
|
||||
@@ -525,18 +405,7 @@
|
||||
else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))
|
||||
{ //player asked us to set internal clock
|
||||
CDVDMsgGeneralResync* pMsgGeneralResync = (CDVDMsgGeneralResync*)pMsg;
|
||||
-
|
||||
- if (pMsgGeneralResync->m_timestamp != DVD_NOPTS_VALUE)
|
||||
- m_audioClock = pMsgGeneralResync->m_timestamp;
|
||||
-
|
||||
- if (pMsgGeneralResync->m_clock)
|
||||
- {
|
||||
- CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_RESYNC(%f, 1)", m_audioClock);
|
||||
- m_av_clock->Discontinuity(m_audioClock);
|
||||
- //m_av_clock->OMXUpdateClock(m_audioClock);
|
||||
- }
|
||||
- else
|
||||
- CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_RESYNC(%f, 0)", m_audioClock);
|
||||
+ CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_RESYNC(%f, %d)", m_audioClock, pMsgGeneralResync->m_clock);
|
||||
m_flush = false;
|
||||
}
|
||||
else if (pMsg->IsType(CDVDMsg::GENERAL_RESET))
|
||||
@@ -559,7 +428,6 @@
|
||||
m_omxAudio.Flush();
|
||||
m_av_clock->OMXReset(false);
|
||||
m_av_clock->UnLock();
|
||||
- m_syncclock = true;
|
||||
m_stalled = true;
|
||||
m_started = false;
|
||||
|
||||
@@ -599,10 +467,6 @@
|
||||
m_speed = static_cast<CDVDMsgInt*>(pMsg)->m_value;
|
||||
CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::PLAYER_SETSPEED %d", m_speed);
|
||||
}
|
||||
- if (m_speed != DVD_PLAYSPEED_NORMAL)
|
||||
- {
|
||||
- m_syncclock = true;
|
||||
- }
|
||||
}
|
||||
else if (pMsg->IsType(CDVDMsg::AUDIO_SILENCE))
|
||||
{
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerAudio.h xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerAudio.h
|
||||
--- xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerAudio.h 2013-05-02 17:00:08.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerAudio.h 2013-06-12 23:56:33.135924691 +0200
|
||||
@@ -60,19 +60,6 @@
|
||||
int m_speed;
|
||||
bool m_silence;
|
||||
double m_audioClock;
|
||||
- double m_error; //last average error
|
||||
-
|
||||
- int64_t m_errortime; //timestamp of last time we measured
|
||||
- int64_t m_freq;
|
||||
-
|
||||
- void HandleSyncError(double duration);
|
||||
- double m_errorbuff; //place to store average errors
|
||||
- int m_errorcount;//number of errors stored
|
||||
- bool m_syncclock;
|
||||
-
|
||||
- double m_integral; //integral correction for resampler
|
||||
- int m_skipdupcount; //counter for skip/duplicate synctype
|
||||
- bool m_prevskipped;
|
||||
|
||||
bool m_stalled;
|
||||
bool m_started;
|
||||
@@ -82,8 +69,6 @@
|
||||
struct timespec m_starttime, m_endtime;
|
||||
bool m_buffer_empty;
|
||||
bool m_flush;
|
||||
- //SYNC_DISCON, SYNC_SKIPDUP, SYNC_RESAMPLE
|
||||
- int m_synctype;
|
||||
int m_nChannels;
|
||||
bool m_DecoderOpen;
|
||||
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerVideo.cpp xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
|
||||
--- xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerVideo.cpp 2013-05-02 17:00:07.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerVideo.cpp 2013-06-13 00:11:56.443044388 +0200
|
||||
@@ -89,7 +89,6 @@
|
||||
m_iVideoDelay = 0;
|
||||
m_droptime = 0.0;
|
||||
m_dropbase = 0.0;
|
||||
- m_autosync = 1;
|
||||
m_fForcedAspectRatio = 0.0f;
|
||||
m_messageQueue.SetMaxDataSize(10 * 1024 * 1024);
|
||||
m_messageQueue.SetMaxTimeSize(8.0);
|
||||
@@ -115,7 +114,6 @@
|
||||
m_started = false;
|
||||
m_flush = false;
|
||||
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
|
||||
- m_autosync = 1;
|
||||
m_iSleepEndTime = DVD_NOPTS_VALUE;
|
||||
// force SetVideoRect to be called initially
|
||||
m_dst_rect.SetRect(0, 0, 0, 0);
|
||||
@@ -280,11 +278,6 @@
|
||||
iClockSleep = min(iClockSleep, DVD_MSEC_TO_TIME(500));
|
||||
iFrameSleep = min(iFrameSleep, DVD_MSEC_TO_TIME(500));
|
||||
|
||||
- if( m_stalled )
|
||||
- iSleepTime = iFrameSleep;
|
||||
- else
|
||||
- iSleepTime = iFrameSleep + (iClockSleep - iFrameSleep) / m_autosync;
|
||||
-
|
||||
// present the current pts of this frame to user, and include the actual
|
||||
// presentation delay, to allow him to adjust for it
|
||||
if( m_stalled )
|
||||
@@ -398,22 +391,7 @@
|
||||
else if (pMsg->IsType(CDVDMsg::GENERAL_RESYNC))
|
||||
{
|
||||
CDVDMsgGeneralResync* pMsgGeneralResync = (CDVDMsgGeneralResync*)pMsg;
|
||||
-
|
||||
- if(pMsgGeneralResync->m_timestamp != DVD_NOPTS_VALUE)
|
||||
- pts = pMsgGeneralResync->m_timestamp;
|
||||
-
|
||||
- double delay = m_FlipTimeStamp - m_av_clock->GetAbsoluteClock();
|
||||
- if( delay > frametime ) delay = frametime;
|
||||
- else if( delay < 0 ) delay = 0;
|
||||
-
|
||||
- if(pMsgGeneralResync->m_clock)
|
||||
- {
|
||||
- CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_RESYNC(%f, 1)", pts);
|
||||
- m_av_clock->Discontinuity(pts - delay);
|
||||
- //m_av_clock->OMXUpdateClock(pts - delay);
|
||||
- }
|
||||
- else
|
||||
- CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_RESYNC(%f, 0)", pts);
|
||||
+ CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_RESYNC(%f, %d)", pts, pMsgGeneralResync->m_clock);
|
||||
|
||||
pMsgGeneralResync->Release();
|
||||
continue;
|
||||
diff -Naur xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerVideo.h xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerVideo.h
|
||||
--- xbmc-12.2.0/xbmc/cores/omxplayer/OMXPlayerVideo.h 2013-05-02 17:00:07.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/xbmc/cores/omxplayer/OMXPlayerVideo.h 2013-06-12 23:57:42.278013434 +0200
|
||||
@@ -66,7 +66,6 @@
|
||||
std::string m_codecname;
|
||||
double m_droptime;
|
||||
double m_dropbase;
|
||||
- unsigned int m_autosync;
|
||||
double m_iSubtitleDelay;
|
||||
bool m_bRenderSubs;
|
||||
bool m_bAllowFullscreen;
|
@ -1,26 +0,0 @@
|
||||
From aa12d4ae8315ef4b14c01e3595ea984f8c605639 Mon Sep 17 00:00:00 2001
|
||||
From: fritsch <peter.fruehberger@gmail.com>
|
||||
Date: Mon, 10 Jun 2013 22:20:13 +0200
|
||||
Subject: [PATCH] AE: Workaround (ugly) non existing channel maps in old ffmpeg
|
||||
(workarounds: #14407)
|
||||
|
||||
---
|
||||
xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
|
||||
index 985a01c..880b710 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
|
||||
@@ -319,6 +319,8 @@ void CDVDAudioCodecFFmpeg::BuildChannelMap()
|
||||
{
|
||||
CLog::Log(LOGINFO, "CDVDAudioCodecFFmpeg::GetChannelMap - FFmpeg reported %d channels, but the layout contains %d ignoring", m_pCodecContext->channels, bits);
|
||||
layout = m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels);
|
||||
+ while(layout == 0 && m_pCodecContext->channels > 2)
|
||||
+ layout = m_dllAvUtil.av_get_default_channel_layout(--m_pCodecContext->channels);
|
||||
}
|
||||
|
||||
m_channelLayout.Reset();
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff -Naur xbmc-12.2.0/lib/libdvd/libdvdread/src/dvd_reader.c xbmc-12.2.0.patch/lib/libdvd/libdvdread/src/dvd_reader.c
|
||||
--- xbmc-12.2.0/lib/libdvd/libdvdread/src/dvd_reader.c 2013-05-02 17:00:11.000000000 +0200
|
||||
+++ xbmc-12.2.0.patch/lib/libdvd/libdvdread/src/dvd_reader.c 2013-06-18 07:08:23.973913805 +0200
|
||||
@@ -423,6 +423,9 @@
|
||||
/* Also WIN32 does not have symlinks, so we don't need this bit of code. */
|
||||
|
||||
/* Resolve any symlinks and get the absolut dir name. */
|
||||
+#if defined(_XBMC) /* for XBMC, only do symlink resolution for (real) non-xbmc-VFS paths */
|
||||
+ if ( path[0] == '/' )
|
||||
+#endif // _XBMC
|
||||
{
|
||||
char *new_path;
|
||||
int cdir = open( ".", O_RDONLY );
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
||||
diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp
|
||||
index ed31c04..34fcfae 100644
|
||||
--- a/xbmc/windowing/WinEventsX11.cpp
|
||||
+++ b/xbmc/windowing/WinEventsX11.cpp
|
||||
@@ -709,7 +709,6 @@ bool CWinEventsX11::ProcessShortcuts(XBMC_Event& event)
|
||||
switch(event.key.keysym.sym)
|
||||
{
|
||||
case XBMCK_TAB: // ALT+TAB to minimize/hide
|
||||
- g_application.Minimize();
|
||||
return true;
|
||||
|
||||
default:
|
@ -1,27 +0,0 @@
|
||||
From 7abb1f31a53cc0147ba6f5ed5fc796e2ac8584ff Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Thu, 9 May 2013 21:11:47 +0300
|
||||
Subject: [PATCH] xbmc: revert 799d6ff03 (setwakeup.sh)
|
||||
|
||||
this reverts upstream commit 799d6ff03
|
||||
https://github.com/xbmc/xbmc/commit/799d6ff03
|
||||
---
|
||||
xbmc/settings/GUISettings.cpp | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
|
||||
index 67aeec9..96f738c 100644
|
||||
--- a/xbmc/settings/GUISettings.cpp
|
||||
+++ b/xbmc/settings/GUISettings.cpp
|
||||
@@ -1001,7 +1001,7 @@ void CGUISettings::Initialize()
|
||||
AddBool(pvrpwr, "pvrpowermanagement.enabled", 305, false);
|
||||
AddSeparator(pvrpwr, "pvrpowermanagement.sep1");
|
||||
AddInt(pvrpwr, "pvrpowermanagement.backendidletime", 19244, 15, 0, 5, 360, SPIN_CONTROL_INT_PLUS, MASK_MINS, TEXT_OFF);
|
||||
- AddString(pvrpwr, "pvrpowermanagement.setwakeupcmd", 19245, "", EDIT_CONTROL_INPUT, true);
|
||||
+ AddString(pvrpwr, "pvrpowermanagement.setwakeupcmd", 19245, "/usr/bin/setwakeup.sh", EDIT_CONTROL_INPUT, true);
|
||||
AddInt(pvrpwr, "pvrpowermanagement.prewakeup", 19246, 15, 0, 1, 60, SPIN_CONTROL_INT_PLUS, MASK_MINS, TEXT_OFF);
|
||||
AddSeparator(pvrpwr, "pvrpowermanagement.sep2");
|
||||
AddBool(pvrpwr, "pvrpowermanagement.dailywakeup", 19247, false);
|
||||
--
|
||||
1.7.2.5
|
||||
|
@ -1,57 +0,0 @@
|
||||
diff -Naur xbmc-12.1.8/xbmc/cores/dvdplayer/DVDPlayer.cpp xbmc-12.1.8.patch/xbmc/cores/dvdplayer/DVDPlayer.cpp
|
||||
--- xbmc-12.1.8/xbmc/cores/dvdplayer/DVDPlayer.cpp 2013-04-24 23:38:36.000000000 +0200
|
||||
+++ xbmc-12.1.8.patch/xbmc/cores/dvdplayer/DVDPlayer.cpp 2013-04-26 00:49:07.732011721 +0200
|
||||
@@ -470,7 +470,7 @@
|
||||
#endif
|
||||
|
||||
Create();
|
||||
- if(!m_ready.WaitMSec(100))
|
||||
+ if(!m_ready.WaitMSec(g_advancedSettings.m_videoBusyDialogDelay_ms))
|
||||
{
|
||||
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
|
||||
if(dialog)
|
||||
diff -Naur xbmc-12.1.8/xbmc/cores/omxplayer/OMXPlayer.cpp xbmc-12.1.8.patch/xbmc/cores/omxplayer/OMXPlayer.cpp
|
||||
--- xbmc-12.1.8/xbmc/cores/omxplayer/OMXPlayer.cpp 2013-04-24 23:38:36.000000000 +0200
|
||||
+++ xbmc-12.1.8.patch/xbmc/cores/omxplayer/OMXPlayer.cpp 2013-04-26 00:50:56.974691417 +0200
|
||||
@@ -474,7 +474,7 @@
|
||||
g_renderManager.PreInit();
|
||||
|
||||
Create();
|
||||
- if(!m_ready.WaitMSec(100))
|
||||
+ if(!m_ready.WaitMSec(g_advancedSettings.m_videoBusyDialogDelay_ms))
|
||||
{
|
||||
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
|
||||
if(dialog)
|
||||
diff -Naur xbmc-12.1.8/xbmc/settings/AdvancedSettings.cpp xbmc-12.1.8.patch/xbmc/settings/AdvancedSettings.cpp
|
||||
--- xbmc-12.1.8/xbmc/settings/AdvancedSettings.cpp 2013-04-26 00:48:59.375036542 +0200
|
||||
+++ xbmc-12.1.8.patch/xbmc/settings/AdvancedSettings.cpp 2013-04-26 00:49:07.732011721 +0200
|
||||
@@ -111,6 +111,7 @@
|
||||
m_DXVAForceProcessorRenderer = true;
|
||||
m_DXVANoDeintProcForProgressive = false;
|
||||
m_videoFpsDetect = 1;
|
||||
+ m_videoBusyDialogDelay_ms = 100;
|
||||
m_videoDefaultLatency = 0.0;
|
||||
m_videoDisableHi10pMultithreading = false;
|
||||
|
||||
@@ -592,6 +593,10 @@
|
||||
//0 = disable fps detect, 1 = only detect on timestamps with uniform spacing, 2 detect on all timestamps
|
||||
XMLUtils::GetInt(pElement, "fpsdetect", m_videoFpsDetect, 0, 2);
|
||||
|
||||
+ // controls the delay, in milliseconds, until
|
||||
+ // the busy dialog is shown when starting video playback.
|
||||
+ XMLUtils::GetInt(pElement, "busydialogdelayms", m_videoBusyDialogDelay_ms, 0, 1000);
|
||||
+
|
||||
// Store global display latency settings
|
||||
TiXmlElement* pVideoLatency = pElement->FirstChildElement("latency");
|
||||
if (pVideoLatency)
|
||||
diff -Naur xbmc-12.1.8/xbmc/settings/AdvancedSettings.h xbmc-12.1.8.patch/xbmc/settings/AdvancedSettings.h
|
||||
--- xbmc-12.1.8/xbmc/settings/AdvancedSettings.h 2013-04-26 00:48:59.383036518 +0200
|
||||
+++ xbmc-12.1.8.patch/xbmc/settings/AdvancedSettings.h 2013-04-26 00:49:07.732011721 +0200
|
||||
@@ -165,6 +165,7 @@
|
||||
bool m_DXVANoDeintProcForProgressive;
|
||||
int m_videoFpsDetect;
|
||||
bool m_videoDisableHi10pMultithreading;
|
||||
+ int m_videoBusyDialogDelay_ms;
|
||||
|
||||
CStdString m_videoDefaultPlayer;
|
||||
CStdString m_videoDefaultDVDPlayer;
|
@ -1,746 +0,0 @@
|
||||
From 546fccdd835c5d4e2a1917839ed9d84bd4c53bc2 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Sat, 1 Jun 2013 03:10:19 +0200
|
||||
Subject: [PATCH 1/6] dvdplayer: clock was starting before expected
|
||||
|
||||
---
|
||||
xbmc/cores/dvdplayer/DVDClock.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/dvdplayer/DVDClock.cpp b/xbmc/cores/dvdplayer/DVDClock.cpp
|
||||
index 9eb744f..b8cceeb 100644
|
||||
--- a/xbmc/cores/dvdplayer/DVDClock.cpp
|
||||
+++ b/xbmc/cores/dvdplayer/DVDClock.cpp
|
||||
@@ -233,7 +233,8 @@ double CDVDClock::SystemToPlaying(int64_t system)
|
||||
{
|
||||
m_startClock = system;
|
||||
m_systemUsed = m_systemFrequency;
|
||||
- m_pauseClock = 0;
|
||||
+ if(m_pauseClock)
|
||||
+ m_pauseClock = m_startClock;
|
||||
m_iDisc = 0;
|
||||
m_bReset = false;
|
||||
}
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From c047cc15cd5dcc35bd951e2992cc303b0cbc9b83 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Tue, 28 May 2013 01:00:19 +0200
|
||||
Subject: [PATCH 2/6] SoftAE: make sure we hold sink lock when we consume and
|
||||
write to sink
|
||||
|
||||
This make sure that sink delay and buffers are kept in line.
|
||||
|
||||
Conflicts:
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 78 +++++++++-----------
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 2 +
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 6 +-
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp | 4 -
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp | 3 +-
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 11 +++
|
||||
xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 16 +---
|
||||
7 files changed, 52 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
index 983cd9a..ec6cc38 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
@@ -1212,6 +1212,34 @@ bool CSoftAE::FinalizeSamples(float *buffer, unsigned int samples, bool hasAudio
|
||||
return true;
|
||||
}
|
||||
|
||||
+unsigned int CSoftAE::WriteSink(CAEBuffer& src, uint8_t *data, bool hasAudio)
|
||||
+{
|
||||
+ CExclusiveLock lock(m_sinkLock); /* lock to maintain delay consistency */
|
||||
+ while(m_sink)
|
||||
+ {
|
||||
+ int frames = m_sink->AddPackets(data, m_sinkFormat.m_frames, hasAudio);
|
||||
+
|
||||
+ /* Return value of INT_MAX signals error in sink - restart */
|
||||
+ if (frames == INT_MAX)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "CSoftAE::WriteSink - sink error - reinit flagged");
|
||||
+ m_reOpen = true;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (frames)
|
||||
+ {
|
||||
+ m_buffer.Shift(NULL, frames * m_sinkFormat.m_frameSize);
|
||||
+ return frames;
|
||||
+ }
|
||||
+
|
||||
+ lock.Leave();
|
||||
+ Sleep((500 * m_sinkFormat.m_frames) / m_sinkFormat.m_sampleRate);
|
||||
+ lock.Enter();
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int CSoftAE::RunOutputStage(bool hasAudio)
|
||||
{
|
||||
const unsigned int needSamples = m_sinkFormat.m_frames * m_sinkFormat.m_channelLayout.Count();
|
||||
@@ -1222,7 +1250,6 @@ int CSoftAE::RunOutputStage(bool hasAudio)
|
||||
void *data = m_buffer.Raw(needBytes);
|
||||
hasAudio = FinalizeSamples((float*)data, needSamples, hasAudio);
|
||||
|
||||
- int wroteFrames = 0;
|
||||
if (m_convertFn)
|
||||
{
|
||||
const unsigned int convertedBytes = m_sinkFormat.m_frames * m_sinkFormat.m_frameSize;
|
||||
@@ -1232,22 +1259,7 @@ int CSoftAE::RunOutputStage(bool hasAudio)
|
||||
data = m_converted;
|
||||
}
|
||||
|
||||
- /* Output frames to sink */
|
||||
- if (m_sink)
|
||||
- wroteFrames = m_sink->AddPackets((uint8_t*)data, m_sinkFormat.m_frames, hasAudio);
|
||||
-
|
||||
- /* Return value of INT_MAX signals error in sink - restart */
|
||||
- if (wroteFrames == INT_MAX)
|
||||
- {
|
||||
- CLog::Log(LOGERROR, "CSoftAE::RunOutputStage - sink error - reinit flagged");
|
||||
- wroteFrames = 0;
|
||||
- m_reOpen = true;
|
||||
- }
|
||||
-
|
||||
- if (wroteFrames)
|
||||
- m_buffer.Shift(NULL, wroteFrames * m_sinkFormat.m_channelLayout.Count() * sizeof(float));
|
||||
-
|
||||
- return wroteFrames;
|
||||
+ return WriteSink(m_buffer, (uint8_t*)data, hasAudio);
|
||||
}
|
||||
|
||||
int CSoftAE::RunRawOutputStage(bool hasAudio)
|
||||
@@ -1275,20 +1287,7 @@ int CSoftAE::RunRawOutputStage(bool hasAudio)
|
||||
data = m_converted;
|
||||
}
|
||||
|
||||
- int wroteFrames = 0;
|
||||
- if (m_sink)
|
||||
- wroteFrames = m_sink->AddPackets((uint8_t *)data, m_sinkFormat.m_frames, hasAudio);
|
||||
-
|
||||
- /* Return value of INT_MAX signals error in sink - restart */
|
||||
- if (wroteFrames == INT_MAX)
|
||||
- {
|
||||
- CLog::Log(LOGERROR, "CSoftAE::RunRawOutputStage - sink error - reinit flagged");
|
||||
- wroteFrames = 0;
|
||||
- m_reOpen = true;
|
||||
- }
|
||||
-
|
||||
- m_buffer.Shift(NULL, wroteFrames * m_sinkFormat.m_frameSize);
|
||||
- return wroteFrames;
|
||||
+ return WriteSink(m_buffer, (uint8_t*)data, hasAudio);
|
||||
}
|
||||
|
||||
int CSoftAE::RunTranscodeStage(bool hasAudio)
|
||||
@@ -1316,33 +1315,24 @@ int CSoftAE::RunTranscodeStage(bool hasAudio)
|
||||
buffer = m_buffer.Raw(block);
|
||||
|
||||
encodedFrames = m_encoder->Encode((float*)buffer, m_encoderFormat.m_frames);
|
||||
- m_buffer.Shift(NULL, encodedFrames * m_encoderFormat.m_frameSize);
|
||||
|
||||
uint8_t *packet;
|
||||
unsigned int size = m_encoder->GetData(&packet);
|
||||
|
||||
+ CExclusiveLock sinkLock(m_sinkLock); /* lock to maintain delay consistency */
|
||||
+
|
||||
/* if there is not enough space for another encoded packet enlarge the buffer */
|
||||
if (m_encodedBuffer.Free() < size)
|
||||
m_encodedBuffer.ReAlloc(m_encodedBuffer.Used() + size);
|
||||
|
||||
+ m_buffer.Shift(NULL, encodedFrames * m_encoderFormat.m_frameSize);
|
||||
m_encodedBuffer.Push(packet, size);
|
||||
}
|
||||
|
||||
/* if we have enough data to write */
|
||||
if (m_encodedBuffer.Used() >= sinkBlock)
|
||||
- {
|
||||
- int wroteFrames = m_sink->AddPackets((uint8_t*)m_encodedBuffer.Raw(sinkBlock), m_sinkFormat.m_frames, hasAudio);
|
||||
-
|
||||
- /* Return value of INT_MAX signals error in sink - restart */
|
||||
- if (wroteFrames == INT_MAX)
|
||||
- {
|
||||
- CLog::Log(LOGERROR, "CSoftAE::RunTranscodeStage - sink error - reinit flagged");
|
||||
- wroteFrames = 0;
|
||||
- m_reOpen = true;
|
||||
- }
|
||||
+ WriteSink(m_encodedBuffer, (uint8_t*)m_encodedBuffer.Raw(sinkBlock), hasAudio);
|
||||
|
||||
- m_encodedBuffer.Shift(NULL, wroteFrames * m_sinkFormat.m_frameSize);
|
||||
- }
|
||||
return encodedFrames;
|
||||
}
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
index 3ddf727..bb2769e 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
@@ -246,5 +246,7 @@ private:
|
||||
|
||||
void RemoveStream(StreamList &streams, CSoftAEStream *stream);
|
||||
void PrintSinks();
|
||||
+
|
||||
+ unsigned int WriteSink(CAEBuffer& src, uint8_t *data, bool hasAudio);
|
||||
};
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||
index 1da026e..6a66859 100644
|
||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
|
||||
@@ -523,11 +523,7 @@ unsigned int CAESinkALSA::AddPackets(uint8_t *data, unsigned int frames, bool ha
|
||||
}
|
||||
|
||||
if ((unsigned int)ret < frames)
|
||||
- {
|
||||
- ret = snd_pcm_wait(m_pcm, m_timeout);
|
||||
- if (ret < 0)
|
||||
- HandleError("snd_pcm_wait", ret);
|
||||
- }
|
||||
+ return 0;
|
||||
|
||||
ret = snd_pcm_writei(m_pcm, (void*)data, frames);
|
||||
if (ret < 0)
|
||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
|
||||
index 8f23b41..4853302 100644
|
||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
|
||||
@@ -209,10 +209,6 @@ unsigned int CAESinkAUDIOTRACK::AddPackets(uint8_t *data, unsigned int frames, b
|
||||
break;
|
||||
}
|
||||
}
|
||||
- // AddPackets runs under a non-idled AE thread we must block or sleep.
|
||||
- // Trying to calc the optimal sleep is tricky so just a minimal sleep.
|
||||
- Sleep(10);
|
||||
-
|
||||
return hasAudio ? write_frames:frames;
|
||||
}
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
|
||||
index f6dc62f..00058ff 100644
|
||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
|
||||
@@ -384,7 +384,8 @@ unsigned int CAESinkDirectSound::AddPackets(uint8_t *data, unsigned int frames,
|
||||
{
|
||||
if (m_isDirtyDS)
|
||||
return INT_MAX;
|
||||
- Sleep(total * 1000 / m_AvgBytesPerSec);
|
||||
+ else
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
while (len)
|
||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp
|
||||
index 970e236..664c761 100644
|
||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
+#include <sys/fcntl.h>
|
||||
|
||||
#if defined(OSS4) || defined(TARGET_FREEBSD)
|
||||
#include <sys/soundcard.h>
|
||||
@@ -320,6 +321,13 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device)
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL, 0) | O_NONBLOCK) == -1)
|
||||
+ {
|
||||
+ close(m_fd);
|
||||
+ CLog::Log(LOGERROR, "CAESinkOSS::Initialize - Failed to set non blocking writes");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
format.m_sampleRate = oss_sr;
|
||||
format.m_frameSize = (CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3) * format.m_channelLayout.Count();
|
||||
format.m_frames = bi.fragsize / format.m_frameSize;
|
||||
@@ -412,6 +420,9 @@ unsigned int CAESinkOSS::AddPackets(uint8_t *data, unsigned int frames, bool has
|
||||
int wrote = write(m_fd, data, size);
|
||||
if (wrote < 0)
|
||||
{
|
||||
+ if(errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
+ return 0;
|
||||
+
|
||||
CLog::Log(LOGERROR, "CAESinkOSS::AddPackets - Failed to write");
|
||||
return INT_MAX;
|
||||
}
|
||||
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
|
||||
index f238d75..89116fa 100644
|
||||
--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
|
||||
@@ -485,22 +485,10 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t *data, unsigned int frames, bool
|
||||
#endif
|
||||
|
||||
/* Wait for Audio Driver to tell us it's got a buffer available */
|
||||
- DWORD eventAudioCallback = WaitForSingleObject(m_needDataEvent, 1100);
|
||||
+ DWORD eventAudioCallback = WaitForSingleObject(m_needDataEvent, 0);
|
||||
|
||||
- if (eventAudioCallback != WAIT_OBJECT_0 || !&buf)
|
||||
- {
|
||||
- /* Event handle timed out - flag sink as dirty for re-initializing */
|
||||
- CLog::Log(LOGERROR, __FUNCTION__": Endpoint Buffer timed out");
|
||||
- if (g_advancedSettings.m_streamSilence)
|
||||
- {
|
||||
- m_isDirty = true; //flag new device or re-init needed
|
||||
- Deinitialize();
|
||||
- m_running = false;
|
||||
- return INT_MAX;
|
||||
- }
|
||||
- m_running = false;
|
||||
+ if (eventAudioCallback != WAIT_OBJECT_0)
|
||||
return 0;
|
||||
- }
|
||||
|
||||
if (!m_running)
|
||||
return 0;
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From 35502583cb7cd56a59e68e1514a2fccb63b2a1a2 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Tue, 28 May 2013 01:03:08 +0200
|
||||
Subject: [PATCH 3/6] SoftAE: let SoftAEStream share SoftAE stream lock
|
||||
|
||||
This avoids holding an internal stream lock, while soft ae
|
||||
is trying to read out new frames and allow us to properly
|
||||
hold lock while requesting delays.
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 2 +-
|
||||
.../AudioEngine/Engines/SoftAE/SoftAEStream.cpp | 51 +++++++++++++-------
|
||||
.../AudioEngine/Engines/SoftAE/SoftAEStream.h | 4 +-
|
||||
3 files changed, 37 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
index ec6cc38..faf6ccc 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
@@ -775,7 +775,7 @@ IAEStream *CSoftAE::MakeStream(enum AEDataFormat dataFormat, unsigned int sample
|
||||
ASSERT(encodedSampleRate);
|
||||
|
||||
CSingleLock streamLock(m_streamLock);
|
||||
- CSoftAEStream *stream = new CSoftAEStream(dataFormat, sampleRate, encodedSampleRate, channelLayout, options);
|
||||
+ CSoftAEStream *stream = new CSoftAEStream(dataFormat, sampleRate, encodedSampleRate, channelLayout, options, m_streamLock);
|
||||
m_newStreams.push_back(stream);
|
||||
streamLock.Leave();
|
||||
// this is really needed here
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.cpp
|
||||
index 4e8134b..12d00ea 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.cpp
|
||||
@@ -34,7 +34,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
-CSoftAEStream::CSoftAEStream(enum AEDataFormat dataFormat, unsigned int sampleRate, unsigned int encodedSampleRate, CAEChannelInfo channelLayout, unsigned int options) :
|
||||
+CSoftAEStream::CSoftAEStream(enum AEDataFormat dataFormat, unsigned int sampleRate, unsigned int encodedSampleRate, CAEChannelInfo channelLayout, unsigned int options, CCriticalSection& lock) :
|
||||
+ m_lock (lock ),
|
||||
m_resampleRatio (1.0 ),
|
||||
m_internalRatio (1.0 ),
|
||||
m_convertBuffer (NULL ),
|
||||
@@ -74,7 +75,8 @@ CSoftAEStream::CSoftAEStream(enum AEDataFormat dataFormat, unsigned int sampleRa
|
||||
|
||||
void CSoftAEStream::InitializeRemap()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (!AE_IS_RAW(m_initDataFormat))
|
||||
{
|
||||
/* re-init the remappers */
|
||||
@@ -96,7 +98,8 @@ void CSoftAEStream::InitializeRemap()
|
||||
|
||||
void CSoftAEStream::Initialize()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (m_valid)
|
||||
{
|
||||
InternalFlush();
|
||||
@@ -213,14 +216,15 @@ void CSoftAEStream::Initialize()
|
||||
|
||||
void CSoftAEStream::Destroy()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
m_valid = false;
|
||||
m_delete = true;
|
||||
}
|
||||
|
||||
CSoftAEStream::~CSoftAEStream()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
|
||||
InternalFlush();
|
||||
if (m_convert)
|
||||
@@ -241,6 +245,8 @@ CSoftAEStream::~CSoftAEStream()
|
||||
|
||||
unsigned int CSoftAEStream::GetSpace()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (!m_valid || m_draining)
|
||||
return 0;
|
||||
|
||||
@@ -252,7 +258,8 @@ unsigned int CSoftAEStream::GetSpace()
|
||||
|
||||
unsigned int CSoftAEStream::AddData(void *data, unsigned int size)
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (!m_valid || size == 0 || data == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -415,7 +422,7 @@ unsigned int CSoftAEStream::ProcessFrameBuffer()
|
||||
|
||||
uint8_t* CSoftAEStream::GetFrame()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
|
||||
/* if we are fading, this runs even if we have underrun as it is time based */
|
||||
if (m_fadeRunning)
|
||||
@@ -486,6 +493,8 @@ uint8_t* CSoftAEStream::GetFrame()
|
||||
|
||||
double CSoftAEStream::GetDelay()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (m_delete)
|
||||
return 0.0;
|
||||
|
||||
@@ -497,6 +506,8 @@ double CSoftAEStream::GetDelay()
|
||||
|
||||
double CSoftAEStream::GetCacheTime()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (m_delete)
|
||||
return 0.0;
|
||||
|
||||
@@ -508,6 +519,8 @@ double CSoftAEStream::GetCacheTime()
|
||||
|
||||
double CSoftAEStream::GetCacheTotal()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (m_delete)
|
||||
return 0.0;
|
||||
|
||||
@@ -519,6 +532,8 @@ double CSoftAEStream::GetCacheTotal()
|
||||
|
||||
void CSoftAEStream::Pause()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (m_paused)
|
||||
return;
|
||||
m_paused = true;
|
||||
@@ -527,6 +542,8 @@ void CSoftAEStream::Pause()
|
||||
|
||||
void CSoftAEStream::Resume()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
+
|
||||
if (!m_paused)
|
||||
return;
|
||||
m_paused = false;
|
||||
@@ -536,20 +553,20 @@ void CSoftAEStream::Resume()
|
||||
|
||||
void CSoftAEStream::Drain()
|
||||
{
|
||||
- CSharedLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
m_draining = true;
|
||||
}
|
||||
|
||||
bool CSoftAEStream::IsDrained()
|
||||
{
|
||||
- CSharedLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
return (m_draining && !m_packet && m_outBuffer.empty());
|
||||
}
|
||||
|
||||
void CSoftAEStream::Flush()
|
||||
{
|
||||
CLog::Log(LOGDEBUG, "CSoftAEStream::Flush");
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
InternalFlush();
|
||||
|
||||
/* internal flush does not do this as these samples are still valid if we are re-initializing */
|
||||
@@ -591,10 +608,10 @@ void CSoftAEStream::InternalFlush()
|
||||
|
||||
double CSoftAEStream::GetResampleRatio()
|
||||
{
|
||||
+ CSingleLock lock(m_lock);
|
||||
if (!m_resample)
|
||||
return 1.0f;
|
||||
|
||||
- CSharedLock lock(m_lock);
|
||||
return m_ssrcData.src_ratio;
|
||||
}
|
||||
|
||||
@@ -603,7 +620,7 @@ bool CSoftAEStream::SetResampleRatio(double ratio)
|
||||
if (!m_resample)
|
||||
return false;
|
||||
|
||||
- CSharedLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
|
||||
int oldRatioInt = (int)std::ceil(m_ssrcData.src_ratio);
|
||||
|
||||
@@ -624,7 +641,7 @@ bool CSoftAEStream::SetResampleRatio(double ratio)
|
||||
|
||||
void CSoftAEStream::RegisterAudioCallback(IAudioCallback* pCallback)
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
m_vizBufferSamples = 0;
|
||||
m_audioCallback = pCallback;
|
||||
if (m_audioCallback)
|
||||
@@ -633,7 +650,7 @@ void CSoftAEStream::RegisterAudioCallback(IAudioCallback* pCallback)
|
||||
|
||||
void CSoftAEStream::UnRegisterAudioCallback()
|
||||
{
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
m_audioCallback = NULL;
|
||||
m_vizBufferSamples = 0;
|
||||
}
|
||||
@@ -644,7 +661,7 @@ void CSoftAEStream::FadeVolume(float from, float target, unsigned int time)
|
||||
if (AE_IS_RAW(m_initDataFormat))
|
||||
return;
|
||||
|
||||
- CExclusiveLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
float delta = target - from;
|
||||
m_fadeDirUp = target > from;
|
||||
m_fadeTarget = target;
|
||||
@@ -654,13 +671,13 @@ void CSoftAEStream::FadeVolume(float from, float target, unsigned int time)
|
||||
|
||||
bool CSoftAEStream::IsFading()
|
||||
{
|
||||
- CSharedLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
return m_fadeRunning;
|
||||
}
|
||||
|
||||
void CSoftAEStream::RegisterSlave(IAEStream *slave)
|
||||
{
|
||||
- CSharedLock lock(m_lock);
|
||||
+ CSingleLock lock(m_lock);
|
||||
m_slave = (CSoftAEStream*)slave;
|
||||
}
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.h
|
||||
index 7e93215..1b715fc 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.h
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAEStream.h
|
||||
@@ -36,7 +36,7 @@ class CSoftAEStream : public IAEStream
|
||||
{
|
||||
protected:
|
||||
friend class CSoftAE;
|
||||
- CSoftAEStream(enum AEDataFormat format, unsigned int sampleRate, unsigned int encodedSamplerate, CAEChannelInfo channelLayout, unsigned int options);
|
||||
+ CSoftAEStream(enum AEDataFormat format, unsigned int sampleRate, unsigned int encodedSamplerate, CAEChannelInfo channelLayout, unsigned int options, CCriticalSection& lock);
|
||||
virtual ~CSoftAEStream();
|
||||
|
||||
void Initialize();
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
void InternalFlush();
|
||||
void CheckResampleBuffers();
|
||||
|
||||
- CSharedSection m_lock;
|
||||
+ CCriticalSection& m_lock;
|
||||
enum AEDataFormat m_initDataFormat;
|
||||
unsigned int m_initSampleRate;
|
||||
unsigned int m_initEncodedSampleRate;
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From 2fae6e49bf802e204e71e9016be6ba9c68262e46 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Wed, 29 May 2013 22:59:01 +0200
|
||||
Subject: [PATCH 4/6] softae: use correct number of bytes when consuming from
|
||||
src buffer
|
||||
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 10 +++++-----
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 2 +-
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
index faf6ccc..991cb10 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
@@ -1212,7 +1212,7 @@ bool CSoftAE::FinalizeSamples(float *buffer, unsigned int samples, bool hasAudio
|
||||
return true;
|
||||
}
|
||||
|
||||
-unsigned int CSoftAE::WriteSink(CAEBuffer& src, uint8_t *data, bool hasAudio)
|
||||
+unsigned int CSoftAE::WriteSink(CAEBuffer& src, int src_len, uint8_t *data, bool hasAudio)
|
||||
{
|
||||
CExclusiveLock lock(m_sinkLock); /* lock to maintain delay consistency */
|
||||
while(m_sink)
|
||||
@@ -1229,7 +1229,7 @@ unsigned int CSoftAE::WriteSink(CAEBuffer& src, uint8_t *data, bool hasAudio)
|
||||
|
||||
if (frames)
|
||||
{
|
||||
- m_buffer.Shift(NULL, frames * m_sinkFormat.m_frameSize);
|
||||
+ m_buffer.Shift(NULL, src_len);
|
||||
return frames;
|
||||
}
|
||||
|
||||
@@ -1259,7 +1259,7 @@ int CSoftAE::RunOutputStage(bool hasAudio)
|
||||
data = m_converted;
|
||||
}
|
||||
|
||||
- return WriteSink(m_buffer, (uint8_t*)data, hasAudio);
|
||||
+ return WriteSink(m_buffer, needBytes, (uint8_t*)data, hasAudio);
|
||||
}
|
||||
|
||||
int CSoftAE::RunRawOutputStage(bool hasAudio)
|
||||
@@ -1287,7 +1287,7 @@ int CSoftAE::RunRawOutputStage(bool hasAudio)
|
||||
data = m_converted;
|
||||
}
|
||||
|
||||
- return WriteSink(m_buffer, (uint8_t*)data, hasAudio);
|
||||
+ return WriteSink(m_buffer, m_sinkBlockSize, (uint8_t*)data, hasAudio);
|
||||
}
|
||||
|
||||
int CSoftAE::RunTranscodeStage(bool hasAudio)
|
||||
@@ -1331,7 +1331,7 @@ int CSoftAE::RunTranscodeStage(bool hasAudio)
|
||||
|
||||
/* if we have enough data to write */
|
||||
if (m_encodedBuffer.Used() >= sinkBlock)
|
||||
- WriteSink(m_encodedBuffer, (uint8_t*)m_encodedBuffer.Raw(sinkBlock), hasAudio);
|
||||
+ WriteSink(m_encodedBuffer, sinkBlock, (uint8_t*)m_encodedBuffer.Raw(sinkBlock), hasAudio);
|
||||
|
||||
return encodedFrames;
|
||||
}
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
index bb2769e..62914bb 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
@@ -247,6 +247,6 @@ private:
|
||||
void RemoveStream(StreamList &streams, CSoftAEStream *stream);
|
||||
void PrintSinks();
|
||||
|
||||
- unsigned int WriteSink(CAEBuffer& src, uint8_t *data, bool hasAudio);
|
||||
+ unsigned int WriteSink(CAEBuffer& src, int src_len, uint8_t *data, bool hasAudio);
|
||||
};
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From 2e9cd3d009ca93a74624503d9769863415267148 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Wed, 29 May 2013 23:04:14 +0200
|
||||
Subject: [PATCH 5/6] softae: add fail safe to WriteSink to avoid deadlocking
|
||||
on broken output
|
||||
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 13 ++++++++++++-
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h | 1 +
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
index 991cb10..e4faf7b 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
@@ -64,6 +64,7 @@ CSoftAE::CSoftAE():
|
||||
m_softSuspend (false ),
|
||||
m_softSuspendTimer (0 ),
|
||||
m_sink (NULL ),
|
||||
+ m_sinkBlockTime (0 ),
|
||||
m_transcode (false ),
|
||||
m_rawPassthrough (false ),
|
||||
m_soundMode (AE_SOUND_OFF),
|
||||
@@ -350,6 +351,7 @@ void CSoftAE::InternalOpenSink()
|
||||
m_sinkFormatSampleRateMul = 1.0 / (double)newFormat.m_sampleRate;
|
||||
m_sinkFormatFrameSizeMul = 1.0 / (double)newFormat.m_frameSize;
|
||||
m_sinkBlockSize = newFormat.m_frames * newFormat.m_frameSize;
|
||||
+ m_sinkBlockTime = 1000 * newFormat.m_frames / newFormat.m_sampleRate;
|
||||
// check if sink controls volume, if so, init the volume.
|
||||
m_sinkHandlesVolume = m_sink->HasVolume();
|
||||
if (m_sinkHandlesVolume)
|
||||
@@ -1215,6 +1217,8 @@ bool CSoftAE::FinalizeSamples(float *buffer, unsigned int samples, bool hasAudio
|
||||
unsigned int CSoftAE::WriteSink(CAEBuffer& src, int src_len, uint8_t *data, bool hasAudio)
|
||||
{
|
||||
CExclusiveLock lock(m_sinkLock); /* lock to maintain delay consistency */
|
||||
+
|
||||
+ XbmcThreads::EndTime timeout(m_sinkBlockTime * 2);
|
||||
while(m_sink)
|
||||
{
|
||||
int frames = m_sink->AddPackets(data, m_sinkFormat.m_frames, hasAudio);
|
||||
@@ -1233,8 +1237,15 @@ unsigned int CSoftAE::WriteSink(CAEBuffer& src, int src_len, uint8_t *data, bool
|
||||
return frames;
|
||||
}
|
||||
|
||||
+ if(timeout.IsTimePast())
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "CSoftAE::WriteSink - sink blocked- reinit flagged");
|
||||
+ m_reOpen = true;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
lock.Leave();
|
||||
- Sleep((500 * m_sinkFormat.m_frames) / m_sinkFormat.m_sampleRate);
|
||||
+ Sleep(m_sinkBlockTime / 4);
|
||||
lock.Enter();
|
||||
}
|
||||
return 0;
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
index 62914bb..23e0ea3 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
|
||||
@@ -165,6 +165,7 @@ private:
|
||||
double m_sinkFormatSampleRateMul;
|
||||
double m_sinkFormatFrameSizeMul;
|
||||
unsigned int m_sinkBlockSize;
|
||||
+ unsigned int m_sinkBlockTime;
|
||||
bool m_sinkHandlesVolume;
|
||||
AEAudioFormat m_encoderFormat;
|
||||
double m_encoderFrameSizeMul;
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From 7a81b2a0e9822688d9681756414b753815bf9e21 Mon Sep 17 00:00:00 2001
|
||||
From: Joakim Plate <elupus@xbmc.org>
|
||||
Date: Sat, 1 Jun 2013 18:22:43 +0200
|
||||
Subject: [PATCH 6/6] softae: use passed buffer not something else when
|
||||
consuming data
|
||||
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
index e4faf7b..e641335 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
|
||||
@@ -1233,7 +1233,7 @@ unsigned int CSoftAE::WriteSink(CAEBuffer& src, int src_len, uint8_t *data, bool
|
||||
|
||||
if (frames)
|
||||
{
|
||||
- m_buffer.Shift(NULL, src_len);
|
||||
+ src.Shift(NULL, src_len);
|
||||
return frames;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
81
tools/mkpkg/mkpkg_xbmc-frodo-oe
Executable file
81
tools/mkpkg/mkpkg_xbmc-frodo-oe
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="xbmc"
|
||||
PKG_VERSION=""
|
||||
GIT_REPO="-b openelec-Frodo git://github.com/OpenELEC/xbmc.git"
|
||||
DEST_DIR="$PKG_NAME-frodo-openelec"
|
||||
|
||||
echo "getting sources..."
|
||||
if [ ! -d $DEST_DIR-latest ]; then
|
||||
git clone $GIT_REPO $DEST_DIR-latest
|
||||
fi
|
||||
|
||||
cd $DEST_DIR-latest
|
||||
git pull
|
||||
|
||||
echo "getting version..."
|
||||
GIT_REV=`git log -n1 --format=%h`
|
||||
echo $GIT_REV
|
||||
cd ..
|
||||
|
||||
if [ -z "$PKG_VERSION" ]; then
|
||||
PKG_VERSION="12.2-$GIT_REV"
|
||||
fi
|
||||
|
||||
echo "copying sources..."
|
||||
rm -rf $PKG_NAME-$PKG_VERSION
|
||||
cp -R $DEST_DIR-latest $PKG_NAME-$PKG_VERSION
|
||||
echo "$GIT_REV" > $PKG_NAME-$PKG_VERSION/VERSION
|
||||
|
||||
echo "cleaning sources..."
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/.git
|
||||
|
||||
echo "seperating theme..."
|
||||
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||
mv $PKG_NAME-$PKG_VERSION/addons/skin.confluence $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||
|
||||
echo "cleaning sources..."
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/visualisations
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/lib/libSDL-*
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/lib/libcurl-*
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/project
|
||||
|
||||
for i in "Changelog" "Fake\ Episode\ Maker" "MingwBuildEnvironment" \
|
||||
"PackageMaker" "Translator" "XBMCLive" "XprPack" \
|
||||
"HardwareConfigure" "Mach5" "osx" "UpdateThumbs.py" "XBMCTex"; do
|
||||
rm -rf $PKG_NAME-$PKG_VERSION/tools/$i
|
||||
done
|
||||
|
||||
for i in dll a lib so bat; do
|
||||
find $PKG_NAME-$PKG_VERSION -name *.$i -exec rm -rf {} ";"
|
||||
done
|
||||
|
||||
# bundled win32 binaries
|
||||
rm -r $PKG_NAME-$PKG_VERSION/xbmc/visualizations/XBMCProjectM/win32
|
||||
|
||||
echo "packing sources..."
|
||||
tar cvJf $PKG_NAME-$PKG_VERSION.tar.xz $PKG_NAME-$PKG_VERSION
|
||||
tar cvJf $PKG_NAME-theme-Confluence-$PKG_VERSION.tar.xz $PKG_NAME-theme-Confluence-$PKG_VERSION
|
||||
|
||||
echo "remove temporary sourcedir..."
|
||||
rm -rf $PKG_NAME-$PKG_VERSION
|
||||
rm -rf $PKG_NAME-theme-Confluence-$PKG_VERSION
|
Loading…
Reference in New Issue
Block a user