kodi: update to kodi-14-ec361ca

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2014-11-23 19:49:01 +01:00
parent 945c1cab95
commit 9435a272a2
3 changed files with 2 additions and 893 deletions

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="kodi-theme-Confluence"
PKG_VERSION="14-23c389a"
PKG_VERSION="14-ec361ca"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -17,7 +17,7 @@
################################################################################
PKG_NAME="kodi"
PKG_VERSION="14-23c389a"
PKG_VERSION="14-ec361ca"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -6641,296 +6641,6 @@ index f947acc..606c24f 100644
void SuspendVideoOutput();
void ResumeVideoOutput();
From d11547514d4ef8e45c92ee1e5f9a080514d80537 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 27 Sep 2014 15:27:04 +0100
Subject: [PATCH 61/96] [omxplayer] Don't sync up to passthrough audio packets
- let GPU handle it
This code was just broken.
When sync is lost it attempts to identify how many bytes to skip to regain sync,
but does nothing with that skip count - just drops the whole frame.
It also stops EAC3 from being passed through.
The GPU has similar sync detection code which does avoid dropping the whole frame,
so just pass the packets through and let GPU deal with it.
---
xbmc/cores/omxplayer/OMXAudio.cpp | 205 --------------------------------------
xbmc/cores/omxplayer/OMXAudio.h | 5 -
2 files changed, 210 deletions(-)
diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp
index db0886e..7c07b57 100644
--- a/xbmc/cores/omxplayer/OMXAudio.cpp
+++ b/xbmc/cores/omxplayer/OMXAudio.cpp
@@ -55,11 +55,6 @@ using namespace std;
#define AUDIO_DECODE_OUTPUT_BUFFER (32*1024)
static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3};
-static const uint16_t AC3Bitrates[] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640};
-static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0};
-
-static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0};
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -86,7 +81,6 @@ COMXAudio::COMXAudio() :
m_av_clock (NULL ),
m_settings_changed(false ),
m_setStartTime (false ),
- m_LostSync (true ),
m_SampleRate (0 ),
m_eEncoding (OMX_AUDIO_CodingPCM),
m_extradata (NULL ),
@@ -978,7 +972,6 @@ bool COMXAudio::Deinitialize()
m_av_clock = NULL;
m_Initialized = false;
- m_LostSync = true;
m_HWDecode = false;
if(m_extradata)
@@ -1018,7 +1011,6 @@ void COMXAudio::Flush()
m_last_pts = DVD_NOPTS_VALUE;
m_submitted = 0.0f;
m_maxLevel = 0.0f;
- m_LostSync = true;
m_setStartTime = true;
}
@@ -1117,20 +1109,6 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt
return len;
}
- if(m_eEncoding == OMX_AUDIO_CodingDTS && m_LostSync && (m_Passthrough || m_HWDecode))
- {
- int skip = SyncDTS((uint8_t *)data, len);
- if(skip > 0)
- return len;
- }
-
- if(m_eEncoding == OMX_AUDIO_CodingDDP && m_LostSync && (m_Passthrough || m_HWDecode))
- {
- int skip = SyncAC3((uint8_t *)data, len);
- if(skip > 0)
- return len;
- }
-
unsigned pitch = (m_Passthrough || m_HWDecode) ? 1:(m_BitsPerSample >> 3) * m_InputChannels;
unsigned int demuxer_samples = len / pitch;
unsigned int demuxer_samples_sent = 0;
@@ -1618,186 +1596,3 @@ void COMXAudio::PrintPCM(OMX_AUDIO_PARAM_PCMMODETYPE *pcm, std::string direction
PrintChannels(pcm->eChannelMapping);
}
-
-void COMXAudio::PrintDDP(OMX_AUDIO_PARAM_DDPTYPE *ddparm)
-{
- CLog::Log(LOGDEBUG, "ddparm->nPortIndex : %d\n", (int)ddparm->nPortIndex);
- CLog::Log(LOGDEBUG, "ddparm->nChannels : %d\n", (int)ddparm->nChannels);
- CLog::Log(LOGDEBUG, "ddparm->nBitRate : %d\n", (int)ddparm->nBitRate);
- CLog::Log(LOGDEBUG, "ddparm->nSampleRate : %d\n", (int)ddparm->nSampleRate);
- CLog::Log(LOGDEBUG, "ddparm->eBitStreamId : %d\n", (int)ddparm->eBitStreamId);
- CLog::Log(LOGDEBUG, "ddparm->eBitStreamMode : %d\n", (int)ddparm->eBitStreamMode);
- CLog::Log(LOGDEBUG, "ddparm->eDolbySurroundMode : %d\n", (int)ddparm->eDolbySurroundMode);
-
- PrintChannels(ddparm->eChannelMapping);
-}
-
-void COMXAudio::PrintDTS(OMX_AUDIO_PARAM_DTSTYPE *dtsparam)
-{
- CLog::Log(LOGDEBUG, "dtsparam->nPortIndex : %d\n", (int)dtsparam->nPortIndex);
- CLog::Log(LOGDEBUG, "dtsparam->nChannels : %d\n", (int)dtsparam->nChannels);
- CLog::Log(LOGDEBUG, "dtsparam->nBitRate : %d\n", (int)dtsparam->nBitRate);
- CLog::Log(LOGDEBUG, "dtsparam->nSampleRate : %d\n", (int)dtsparam->nSampleRate);
- CLog::Log(LOGDEBUG, "dtsparam->nFormat : 0x%08x\n", (int)dtsparam->nFormat);
- CLog::Log(LOGDEBUG, "dtsparam->nDtsType : %d\n", (int)dtsparam->nDtsType);
- CLog::Log(LOGDEBUG, "dtsparam->nDtsFrameSizeBytes : %d\n", (int)dtsparam->nDtsFrameSizeBytes);
-
- PrintChannels(dtsparam->eChannelMapping);
-}
-
-/* ========================== SYNC FUNCTIONS ========================== */
-unsigned int COMXAudio::SyncDTS(BYTE* pData, unsigned int iSize)
-{
- OMX_INIT_STRUCTURE(m_dtsParam);
-
- unsigned int skip;
- unsigned int srCode;
- unsigned int dtsBlocks;
- bool littleEndian;
-
- for(skip = 0; iSize - skip > 8; ++skip, ++pData)
- {
- if (pData[0] == 0x7F && pData[1] == 0xFE && pData[2] == 0x80 && pData[3] == 0x01)
- {
- /* 16bit le */
- littleEndian = true;
- dtsBlocks = ((pData[4] >> 2) & 0x7f) + 1;
- m_dtsParam.nFormat = 0x1 | 0x2;
- }
- else if (pData[0] == 0x1F && pData[1] == 0xFF && pData[2] == 0xE8 && pData[3] == 0x00 && pData[4] == 0x07 && (pData[5] & 0xF0) == 0xF0)
- {
- /* 14bit le */
- littleEndian = true;
- dtsBlocks = (((pData[4] & 0x7) << 4) | (pData[7] & 0x3C) >> 2) + 1;
- m_dtsParam.nFormat = 0x1 | 0x0;
- }
- else if (pData[1] == 0x7F && pData[0] == 0xFE && pData[3] == 0x80 && pData[2] == 0x01)
- {
- /* 16bit be */
- littleEndian = false;
- dtsBlocks = ((pData[5] >> 2) & 0x7f) + 1;
- m_dtsParam.nFormat = 0x0 | 0x2;
- }
- else if (pData[1] == 0x1F && pData[0] == 0xFF && pData[3] == 0xE8 && pData[2] == 0x00 && pData[5] == 0x07 && (pData[4] & 0xF0) == 0xF0)
- {
- /* 14bit be */
- littleEndian = false;
- dtsBlocks = (((pData[5] & 0x7) << 4) | (pData[6] & 0x3C) >> 2) + 1;
- m_dtsParam.nFormat = 0x0 | 0x0;
- }
- else
- {
- continue;
- }
-
- if (littleEndian)
- {
- /* if it is not a termination frame, check the next 6 bits are set */
- if ((pData[4] & 0x80) == 0x80 && (pData[4] & 0x7C) != 0x7C)
- continue;
-
- /* get the frame size */
- m_dtsParam.nDtsFrameSizeBytes = ((((pData[5] & 0x3) << 8 | pData[6]) << 4) | ((pData[7] & 0xF0) >> 4)) + 1;
- srCode = (pData[8] & 0x3C) >> 2;
- }
- else
- {
- /* if it is not a termination frame, check the next 6 bits are set */
- if ((pData[5] & 0x80) == 0x80 && (pData[5] & 0x7C) != 0x7C)
- continue;
-
- /* get the frame size */
- m_dtsParam.nDtsFrameSizeBytes = ((((pData[4] & 0x3) << 8 | pData[7]) << 4) | ((pData[6] & 0xF0) >> 4)) + 1;
- srCode = (pData[9] & 0x3C) >> 2;
- }
-
- /* make sure the framesize is sane */
- if (m_dtsParam.nDtsFrameSizeBytes < 96 || m_dtsParam.nDtsFrameSizeBytes > 16384)
- continue;
-
- m_dtsParam.nSampleRate = DTSFSCod[srCode];
-
- switch(dtsBlocks << 5)
- {
- case 512 :
- m_dtsParam.nDtsType = 1;
- break;
- case 1024:
- m_dtsParam.nDtsType = 2;
- break;
- case 2048:
- m_dtsParam.nDtsType = 3;
- break;
- default:
- m_dtsParam.nDtsType = 0;
- break;
- }
-
- //m_dtsParam.nFormat = 1;
- m_dtsParam.nDtsType = 1;
-
- m_LostSync = false;
-
- return skip;
- }
-
- m_LostSync = true;
- return iSize;
-}
-
-unsigned int COMXAudio::SyncAC3(BYTE* pData, unsigned int iSize)
-{
- unsigned int skip = 0;
-
- for(skip = 0; iSize - skip > 6; ++skip, ++pData)
- {
- /* search for an ac3 sync word */
- if(pData[0] != 0x0b || pData[1] != 0x77)
- continue;
-
- uint8_t fscod = pData[4] >> 6;
- uint8_t frmsizecod = pData[4] & 0x3F;
- uint8_t bsid = pData[5] >> 3;
-
- /* sanity checks on the header */
- if (
- fscod == 3 ||
- frmsizecod > 37 ||
- bsid > 0x11
- ) continue;
-
- /* get the details we need to check crc1 and framesize */
- uint16_t bitrate = AC3Bitrates[frmsizecod >> 1];
- unsigned int framesize = 0;
- switch(fscod)
- {
- case 0: framesize = bitrate * 2; break;
- case 1: framesize = (320 * bitrate / 147 + (frmsizecod & 1 ? 1 : 0)); break;
- case 2: framesize = bitrate * 4; break;
- }
-
- m_SampleRate = AC3FSCod[fscod];
-
- /* dont do extensive testing if we have not lost sync */
- if (!m_LostSync && skip == 0)
- return 0;
-
- unsigned int crc_size;
- /* if we have enough data, validate the entire packet, else try to validate crc2 (5/8 of the packet) */
- if (framesize <= iSize - skip)
- crc_size = framesize - 1;
- else crc_size = (framesize >> 1) + (framesize >> 3) - 1;
-
- if (crc_size <= iSize - skip)
- if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &pData[2], crc_size * 2))
- continue;
-
- /* if we get here, we can sync */
- m_LostSync = false;
- return skip;
- }
-
- /* if we get here, the entire packet is invalid and we have lost sync */
- m_LostSync = true;
- return iSize;
-}
diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h
index 7cf10ad..3ff959f 100644
--- a/xbmc/cores/omxplayer/OMXAudio.h
+++ b/xbmc/cores/omxplayer/OMXAudio.h
@@ -87,10 +87,6 @@ class COMXAudio
static void PrintChannels(OMX_AUDIO_CHANNELTYPE eChannelMapping[]);
void PrintPCM(OMX_AUDIO_PARAM_PCMMODETYPE *pcm, std::string direction);
- void PrintDDP(OMX_AUDIO_PARAM_DDPTYPE *ddparm);
- void PrintDTS(OMX_AUDIO_PARAM_DTSTYPE *dtsparam);
- unsigned int SyncDTS(BYTE* pData, unsigned int iSize);
- unsigned int SyncAC3(BYTE* pData, unsigned int iSize);
void UpdateAttenuation();
bool BadState() const { return !m_Initialized; };
@@ -119,7 +115,6 @@ class COMXAudio
OMXClock *m_av_clock;
bool m_settings_changed;
bool m_setStartTime;
- bool m_LostSync;
int m_SampleRate;
OMX_AUDIO_CODINGTYPE m_eEncoding;
uint8_t *m_extradata;
From e291eaf1767734a93db4fd768a98d137e6e79428 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
@ -8993,69 +8703,6 @@ index ef64076..7ea6ea6 100644
+ CCriticalSection m_players_lock;
};
From dafa705e90a068fe458693d2713a71823fbae982 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 15 Nov 2014 17:14:58 +0000
Subject: [PATCH 83/96] [omxplayer] Fix for out of sync after trickplay
---
xbmc/cores/dvdplayer/DVDPlayer.cpp | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index a102012..6f5fc57 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -2427,7 +2427,24 @@ void CDVDPlayer::HandleMessages()
}
// do a seek after rewind, clock is not in sync with current pts
- if (m_playSpeed < 0 && speed >= 0)
+ if (m_omxplayer_mode)
+ {
+ // when switching from trickplay to normal, we may not have a full set of reference frames
+ // in decoder and we may get corrupt frames out. Seeking to current time will avoid this.
+ if ( (speed != DVD_PLAYSPEED_PAUSE && speed != DVD_PLAYSPEED_NORMAL) ||
+ (m_playSpeed != DVD_PLAYSPEED_PAUSE && m_playSpeed != DVD_PLAYSPEED_NORMAL) )
+ {
+ m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), (speed < 0), true, true, false, true));
+ }
+ else
+ {
+ m_OmxPlayerState.av_clock.OMXPause();
+ }
+
+ m_OmxPlayerState.av_clock.OMXSetSpeed(speed);
+ CLog::Log(LOGDEBUG, "%s::%s CDVDMsg::PLAYER_SETSPEED speed : %d (%d)", "CDVDPlayer", __FUNCTION__, speed, m_playSpeed);
+ }
+ else if (m_playSpeed < 0 && speed >= 0)
{
int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset);
m_messenger.Put(new CDVDMsgPlayerSeek(iTime, true, true, false, false, true));
@@ -2453,23 +2470,6 @@ void CDVDPlayer::HandleMessages()
if (!m_DemuxerPausePending)
m_pDemuxer->SetSpeed(speed);
}
-
- if (m_omxplayer_mode)
- {
- int old_speed = m_playSpeed;
- // when switching from trickplay to normal, we may not have a full set of reference frames
- // in decoder and we may get corrupt frames out. Seeking to current time will avoid this.
- if ( (speed != DVD_PLAYSPEED_PAUSE && speed != DVD_PLAYSPEED_NORMAL) ||
- (old_speed != DVD_PLAYSPEED_PAUSE && old_speed != DVD_PLAYSPEED_NORMAL) )
- {
- m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), (speed < 0), true, true, false, true));
- }
- else
- m_OmxPlayerState.av_clock.OMXPause();
-
- m_OmxPlayerState.av_clock.OMXSetSpeed(speed);
- CLog::Log(LOGDEBUG, "%s::%s CDVDMsg::PLAYER_SETSPEED speed : %d (%d)", "CDVDPlayer", __FUNCTION__, speed, old_speed);
- }
}
else if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_SELECT_NUMBER) && m_messenger.GetPacketCount(CDVDMsg::PLAYER_CHANNEL_SELECT_NUMBER) == 0)
{
From b14c066dcbd7da98f0ac6b56418d80d4d98e5fea Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
@ -9079,544 +8726,6 @@ index 1cc7bc3..2e32367 100644
bool Post(const std::string& strURL, const std::string& strPostData, std::string& strHTML);
bool Get(const std::string& strURL, std::string& strHTML);
From 177238bc70cb05dabf33ccb9db5911f22c98e3ab Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Thu, 13 Nov 2014 18:34:03 +0100
Subject: [PATCH 85/96] changed: Rename confusing CSimpleDoubleCache class to
CDoubleCache
---
xbmc/filesystem/CacheStrategy.cpp | 34 +++++++++++++++++-----------------
xbmc/filesystem/CacheStrategy.h | 6 +++---
xbmc/filesystem/FileCache.cpp | 2 +-
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp
index acc86af..cd19405 100644
--- a/xbmc/filesystem/CacheStrategy.cpp
+++ b/xbmc/filesystem/CacheStrategy.cpp
@@ -272,25 +272,25 @@ CCacheStrategy *CSimpleFileCache::CreateNew()
}
-CSimpleDoubleCache::CSimpleDoubleCache(CCacheStrategy *impl)
+CDoubleCache::CDoubleCache(CCacheStrategy *impl)
{
assert(NULL != impl);
m_pCache = impl;
m_pCacheOld = NULL;
}
-CSimpleDoubleCache::~CSimpleDoubleCache()
+CDoubleCache::~CDoubleCache()
{
delete m_pCache;
delete m_pCacheOld;
}
-int CSimpleDoubleCache::Open()
+int CDoubleCache::Open()
{
return m_pCache->Open();
}
-void CSimpleDoubleCache::Close()
+void CDoubleCache::Close()
{
m_pCache->Close();
if (m_pCacheOld)
@@ -300,27 +300,27 @@ void CSimpleDoubleCache::Close()
}
}
-int CSimpleDoubleCache::WriteToCache(const char *pBuffer, size_t iSize)
+int CDoubleCache::WriteToCache(const char *pBuffer, size_t iSize)
{
return m_pCache->WriteToCache(pBuffer, iSize);
}
-int CSimpleDoubleCache::ReadFromCache(char *pBuffer, size_t iMaxSize)
+int CDoubleCache::ReadFromCache(char *pBuffer, size_t iMaxSize)
{
return m_pCache->ReadFromCache(pBuffer, iMaxSize);
}
-int64_t CSimpleDoubleCache::WaitForData(unsigned int iMinAvail, unsigned int iMillis)
+int64_t CDoubleCache::WaitForData(unsigned int iMinAvail, unsigned int iMillis)
{
return m_pCache->WaitForData(iMinAvail, iMillis);
}
-int64_t CSimpleDoubleCache::Seek(int64_t iFilePosition)
+int64_t CDoubleCache::Seek(int64_t iFilePosition)
{
return m_pCache->Seek(iFilePosition);
}
-void CSimpleDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway)
+void CDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway)
{
if (!clearAnyway && m_pCache->IsCachedPosition(iSourcePosition)
&& (!m_pCacheOld || !m_pCacheOld->IsCachedPosition(iSourcePosition)
@@ -349,27 +349,27 @@ void CSimpleDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway)
m_pCache = tmp;
}
-void CSimpleDoubleCache::EndOfInput()
+void CDoubleCache::EndOfInput()
{
m_pCache->EndOfInput();
}
-bool CSimpleDoubleCache::IsEndOfInput()
+bool CDoubleCache::IsEndOfInput()
{
return m_pCache->IsEndOfInput();
}
-void CSimpleDoubleCache::ClearEndOfInput()
+void CDoubleCache::ClearEndOfInput()
{
m_pCache->ClearEndOfInput();
}
-int64_t CSimpleDoubleCache::CachedDataEndPos()
+int64_t CDoubleCache::CachedDataEndPos()
{
return m_pCache->CachedDataEndPos();
}
-int64_t CSimpleDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition)
+int64_t CDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition)
{
int64_t ret = m_pCache->CachedDataEndPosIfSeekTo(iFilePosition);
if (m_pCacheOld)
@@ -377,13 +377,13 @@ int64_t CSimpleDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition)
return ret;
}
-bool CSimpleDoubleCache::IsCachedPosition(int64_t iFilePosition)
+bool CDoubleCache::IsCachedPosition(int64_t iFilePosition)
{
return m_pCache->IsCachedPosition(iFilePosition) || (m_pCacheOld && m_pCacheOld->IsCachedPosition(iFilePosition));
}
-CCacheStrategy *CSimpleDoubleCache::CreateNew()
+CCacheStrategy *CDoubleCache::CreateNew()
{
- return new CSimpleDoubleCache(m_pCache->CreateNew());
+ return new CDoubleCache(m_pCache->CreateNew());
}
diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h
index 9ea7274..2adb0fc 100644
--- a/xbmc/filesystem/CacheStrategy.h
+++ b/xbmc/filesystem/CacheStrategy.h
@@ -102,10 +102,10 @@ class CSimpleFileCache : public CCacheStrategy {
volatile int64_t m_nReadPosition;
};
-class CSimpleDoubleCache : public CCacheStrategy{
+class CDoubleCache : public CCacheStrategy{
public:
- CSimpleDoubleCache(CCacheStrategy *impl);
- virtual ~CSimpleDoubleCache();
+ CDoubleCache(CCacheStrategy *impl);
+ virtual ~CDoubleCache();
virtual int Open() ;
virtual void Close() ;
diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp
index 50fe9b4..886621f 100644
--- a/xbmc/filesystem/FileCache.cpp
+++ b/xbmc/filesystem/FileCache.cpp
@@ -100,7 +100,7 @@ CFileCache::CFileCache(bool useDoubleCache) : CThread("FileCache")
}
if (useDoubleCache)
{
- m_pCache = new CSimpleDoubleCache(m_pCache);
+ m_pCache = new CDoubleCache(m_pCache);
}
m_seekPossible = 0;
m_cacheFull = false;
From a268664b3d4932945acfc9424f7f4ef0f9a4b50e Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Tue, 11 Nov 2014 13:31:42 +0100
Subject: [PATCH 86/96] fixed: FileCache-full logic was wrong + implement
CanWriteToCache() function
---
xbmc/filesystem/CacheStrategy.cpp | 12 +++++++++++-
xbmc/filesystem/CacheStrategy.h | 3 +++
xbmc/filesystem/CircularCache.cpp | 14 +++++++++++++-
xbmc/filesystem/CircularCache.h | 1 +
xbmc/filesystem/FileCache.cpp | 9 ++++-----
xbmc/filesystem/MemBufferCache.cpp | 11 ++++++++++-
xbmc/filesystem/MemBufferCache.h | 1 +
7 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp
index cd19405..31e0644 100644
--- a/xbmc/filesystem/CacheStrategy.cpp
+++ b/xbmc/filesystem/CacheStrategy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2013 Team XBMC
+ * Copyright (C) 2005-2014 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -126,6 +126,11 @@ void CSimpleFileCache::Close()
m_filename.clear();
}
+bool CSimpleFileCache::CanWriteToCache(size_t iSize)
+{
+ return true; // Can always write since it's a on disk
+}
+
int CSimpleFileCache::WriteToCache(const char *pBuffer, size_t iSize)
{
size_t written = 0;
@@ -300,6 +305,11 @@ void CDoubleCache::Close()
}
}
+bool CDoubleCache::CanWriteToCache(size_t iSize)
+{
+ return m_pCache->CanWriteToCache(iSize); // NOTE: Check the active cache only
+}
+
int CDoubleCache::WriteToCache(const char *pBuffer, size_t iSize)
{
return m_pCache->WriteToCache(pBuffer, iSize);
diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h
index 2adb0fc..7ac4820 100644
--- a/xbmc/filesystem/CacheStrategy.h
+++ b/xbmc/filesystem/CacheStrategy.h
@@ -44,6 +44,7 @@ class CCacheStrategy{
virtual int Open() = 0;
virtual void Close() = 0;
+ virtual bool CanWriteToCache(size_t iSize) = 0;
virtual int WriteToCache(const char *pBuffer, size_t iSize) = 0;
virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) = 0;
virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) = 0;
@@ -76,6 +77,7 @@ class CSimpleFileCache : public CCacheStrategy {
virtual int Open() ;
virtual void Close() ;
+ virtual bool CanWriteToCache(size_t iSize);
virtual int WriteToCache(const char *pBuffer, size_t iSize) ;
virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ;
virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ;
@@ -110,6 +112,7 @@ class CDoubleCache : public CCacheStrategy{
virtual int Open() ;
virtual void Close() ;
+ virtual bool CanWriteToCache(size_t iSize);
virtual int WriteToCache(const char *pBuffer, size_t iSize) ;
virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ;
virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ;
diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp
index b9ae641..1268095 100644
--- a/xbmc/filesystem/CircularCache.cpp
+++ b/xbmc/filesystem/CircularCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2013 Team XBMC
+ * Copyright (C) 2005-2014 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -76,6 +76,18 @@ void CCircularCache::Close()
m_buf = NULL;
}
+bool CCircularCache::CanWriteToCache(size_t iSize)
+{
+ CSingleLock lock(m_sync);
+
+ size_t back = (size_t)(m_cur - m_beg); // Backbuffer size
+ size_t front = (size_t)(m_end - m_cur); // Frontbuffer size
+ size_t limit = m_size - std::min(back, m_size_back) - front;
+
+ // Check if iSize (normally chunk-size) would fit in the cache
+ return (iSize <= limit);
+}
+
/**
* Function will write to m_buf at m_end % m_size location
* it will write at maximum m_size, but it will only write
diff --git a/xbmc/filesystem/CircularCache.h b/xbmc/filesystem/CircularCache.h
index ae9e9b9..ff74f97 100644
--- a/xbmc/filesystem/CircularCache.h
+++ b/xbmc/filesystem/CircularCache.h
@@ -36,6 +36,7 @@ class CCircularCache : public CCacheStrategy
virtual int Open() ;
virtual void Close();
+ virtual bool CanWriteToCache(size_t iSize);
virtual int WriteToCache(const char *buf, size_t len) ;
virtual int ReadFromCache(char *buf, size_t len) ;
virtual int64_t WaitForData(unsigned int minimum, unsigned int iMillis) ;
diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp
index 886621f..f1c2d6d 100644
--- a/xbmc/filesystem/FileCache.cpp
+++ b/xbmc/filesystem/FileCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2013 Team XBMC
+ * Copyright (C) 2005-2014 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -219,7 +219,7 @@ void CFileCache::Process()
{
m_seekEvent.Reset();
int64_t cacheMaxPos = m_pCache->CachedDataEndPosIfSeekTo(m_seekPos);
- cacheReachEOF = cacheMaxPos == m_source.GetLength();
+ cacheReachEOF = (cacheMaxPos == m_source.GetLength());
bool sourceSeekFailed = false;
if (!cacheReachEOF)
{
@@ -264,7 +264,9 @@ void CFileCache::Process()
}
}
+ m_cacheFull = !m_pCache->CanWriteToCache(m_chunkSize);
ssize_t iRead = 0;
+
if (!cacheReachEOF)
iRead = m_source.Read(buffer.get(), m_chunkSize);
if (iRead == 0)
@@ -300,13 +302,10 @@ void CFileCache::Process()
}
else if (iWrite == 0)
{
- m_cacheFull = true;
average.Pause();
m_pCache->m_space.WaitMSec(5);
average.Resume();
}
- else
- m_cacheFull = false;
iTotalWrite += iWrite;
diff --git a/xbmc/filesystem/MemBufferCache.cpp b/xbmc/filesystem/MemBufferCache.cpp
index c430ce8..97e1bcb 100644
--- a/xbmc/filesystem/MemBufferCache.cpp
+++ b/xbmc/filesystem/MemBufferCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2013 Team XBMC
+ * Copyright (C) 2005-2014 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
@@ -67,6 +67,15 @@ void MemBufferCache::Close()
m_forwardBuffer.Clear();
}
+bool MemBufferCache::CanWriteToCache(size_t iSize)
+{
+ CSingleLock lock(m_sync);
+
+ // must also check the forward buffer.
+ // if we have leftovers from the previous seek - we need not read anymore until they are utilized
+ return (m_buffer.getMaxWriteSize() < iSize || m_forwardBuffer.getMaxReadSize() > 0);
+}
+
int MemBufferCache::WriteToCache(const char *pBuffer, size_t iSize)
{
CSingleLock lock(m_sync);
diff --git a/xbmc/filesystem/MemBufferCache.h b/xbmc/filesystem/MemBufferCache.h
index 5574a5b..0031de3 100644
--- a/xbmc/filesystem/MemBufferCache.h
+++ b/xbmc/filesystem/MemBufferCache.h
@@ -40,6 +40,7 @@ class MemBufferCache : public CCacheStrategy
virtual int Open() ;
virtual void Close();
+ virtual bool CanWriteToCache(size_t iSize) ;
virtual int WriteToCache(const char *pBuffer, size_t iSize) ;
virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ;
virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ;
From dc17e5b3e51b0a7f930ab503efabccee07119fa7 Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Wed, 12 Nov 2014 19:26:29 +0100
Subject: [PATCH 87/96] fixed: Don't keep reading source when cache is full
(fixes #15500)
---
xbmc/filesystem/FileCache.cpp | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp
index f1c2d6d..849f4b3 100644
--- a/xbmc/filesystem/FileCache.cpp
+++ b/xbmc/filesystem/FileCache.cpp
@@ -266,25 +266,30 @@ void CFileCache::Process()
m_cacheFull = !m_pCache->CanWriteToCache(m_chunkSize);
ssize_t iRead = 0;
-
- if (!cacheReachEOF)
- iRead = m_source.Read(buffer.get(), m_chunkSize);
- if (iRead == 0)
+ /* Only read from source if there's enough write space in the cache
+ else we may keep disposing data and seeking back on (slow) source
+ */
+ if (!m_cacheFull)
{
- CLog::Log(LOGINFO, "CFileCache::Process - Hit eof.");
- m_pCache->EndOfInput();
-
- // The thread event will now also cause the wait of an event to return a false.
- if (AbortableWait(m_seekEvent) == WAIT_SIGNALED)
+ if (!cacheReachEOF)
+ iRead = m_source.Read(buffer.get(), m_chunkSize);
+ if (iRead == 0)
{
- m_pCache->ClearEndOfInput();
- m_seekEvent.Set(); // hack so that later we realize seek is needed
+ CLog::Log(LOGINFO, "CFileCache::Process - Hit eof.");
+ m_pCache->EndOfInput();
+
+ // The thread event will now also cause the wait of an event to return a false.
+ if (AbortableWait(m_seekEvent) == WAIT_SIGNALED)
+ {
+ m_pCache->ClearEndOfInput();
+ m_seekEvent.Set(); // hack so that later we realize seek is needed
+ }
+ else
+ break;
}
- else
- break;
+ else if (iRead < 0)
+ m_bStop = true;
}
- else if (iRead < 0)
- m_bStop = true;
int iTotalWrite=0;
while (!m_bStop && (iTotalWrite < iRead))
From 73b8411ce9bd7002780ab810e1cdb64956229543 Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Wed, 12 Nov 2014 21:22:40 +0100
Subject: [PATCH 88/96] changed: Use m_StateInput else dvdplayer osd info is 8
seconds delayed
---
xbmc/cores/dvdplayer/DVDPlayer.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 6f5fc57..4f15056 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -2882,10 +2882,10 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo)
if(m_StateInput.cache_bytes >= 0)
{
strBuf += StringUtils::Format(" cache:%s %2.0f%%"
- , StringUtils::SizeToString(m_State.cache_bytes).c_str()
- , m_State.cache_level * 100);
+ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str()
+ , m_StateInput.cache_level * 100);
if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL)
- strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay));
+ strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_StateInput.cache_delay));
}
strGeneralInfo = StringUtils::Format("C( ad:% 6.3f, a/v:% 6.3f%s, dcpu:%2i%% acpu:%2i%% vcpu:%2i%%%s af:%d%% vf:%d%% amp:% 5.2f )"
@@ -2918,10 +2918,10 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo)
if(m_StateInput.cache_bytes >= 0)
{
strBuf += StringUtils::Format(" cache:%s %2.0f%%"
- , StringUtils::SizeToString(m_State.cache_bytes).c_str()
- , m_State.cache_level * 100);
+ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str()
+ , m_StateInput.cache_level * 100);
if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL)
- strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay));
+ strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_StateInput.cache_delay));
}
strGeneralInfo = StringUtils::Format("C( ad:% 6.3f, a/v:% 6.3f%s, dcpu:%2i%% acpu:%2i%% vcpu:%2i%%%s )"
From a14b255858341d2275d708010d463dfa8718c355 Mon Sep 17 00:00:00 2001
From: arnova <arnova@void.org>
Date: Sun, 16 Nov 2014 15:35:20 +0100
Subject: [PATCH 89/96] fixed: Calling WaitForData with full cache caused it to
always block the max. of 5 seconds
---
xbmc/filesystem/CircularCache.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp
index 1268095..f201c26 100644
--- a/xbmc/filesystem/CircularCache.cpp
+++ b/xbmc/filesystem/CircularCache.cpp
@@ -209,6 +209,11 @@ int64_t CCircularCache::Seek(int64_t pos)
// we try to avoid a (heavy) seek on the source
if (pos >= m_end && pos < m_end + 100000)
{
+ /* Make everything in the cache (back & forward), back-cache, to make sure
+ * there's sufficient forward space. Increasing it with only 100000 may not be
+ * sufficient due to variable filesystem chunksize
+ */
+ m_cur = m_end;
lock.Leave();
WaitForData((size_t)(pos - m_cur), 5000);
lock.Enter();
From a7ed8aa54cbb498cb2ec70b861b969f4627d40ed Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 18 Nov 2014 18:53:42 +0000
Subject: [PATCH 90/96] [omxplayer] Fix for EAC3 passthrough
The Pi firmware supports EAC3 passthrough okay, but we weren't correctly enabling support.
See: https://github.com/OpenELEC/OpenELEC.tv/issues/3302
---
xbmc/cores/omxplayer/OMXAudio.h | 1 +
xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h
index 3ff959f..569cb09 100644
--- a/xbmc/cores/omxplayer/OMXAudio.h
+++ b/xbmc/cores/omxplayer/OMXAudio.h
@@ -48,6 +48,7 @@ extern "C" {
#define OMX_IS_RAW(x) \
( \
(x) == AE_FMT_AC3 || \
+ (x) == AE_FMT_EAC3 || \
(x) == AE_FMT_DTS \
)
diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
index f2bb9a2..d305a07 100644
--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
@@ -530,6 +530,11 @@ AEDataFormat OMXPlayerAudio::GetDataFormat(CDVDStreamInfo hints)
dataFormat = AE_FMT_AC3;
m_passthrough = true;
}
+ if(hints.codec == AV_CODEC_ID_EAC3 && CAEFactory::SupportsRaw(AE_FMT_AC3, hints.samplerate * 4) && !CSettings::Get().GetBool("audiooutput.dualaudio"))
+ {
+ dataFormat = AE_FMT_EAC3;
+ m_passthrough = true;
+ }
if(hints.codec == AV_CODEC_ID_DTS && CAEFactory::SupportsRaw(AE_FMT_DTS, hints.samplerate) && !CSettings::Get().GetBool("audiooutput.dualaudio"))
{
dataFormat = AE_FMT_DTS;
From a46ca6afdb5d9220bc1836a0e313c747040b3ebb Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 19 Nov 2014 13:29:43 +0000