Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream-ro/master'

  • Loading branch information...
commit a5a24b14204c93f6bb3a9cbbe9dfd12450cf80a0 2 parents f94256c + f8f5a56
@opdenkamp authored
View
3  project/VS2010Express/XBMC.vcxproj
@@ -1020,8 +1020,6 @@
<ClInclude Include="..\..\xbmc\filesystem\Directory.h" />
<ClInclude Include="..\..\xbmc\filesystem\DirectoryFactory.h" />
<ClInclude Include="..\..\xbmc\filesystem\DirectoryHistory.h" />
- <ClInclude Include="..\..\xbmc\filesystem\DllHDHomeRunDirectory.h" />
- <ClInclude Include="..\..\xbmc\filesystem\DllHDHomeRunFile.h" />
<ClInclude Include="..\..\xbmc\filesystem\DllLibAfp.h" />
<ClInclude Include="..\..\xbmc\filesystem\DllLibCMyth.h" />
<ClInclude Include="..\..\xbmc\filesystem\DllLibCurl.h" />
@@ -1108,7 +1106,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">true</ExcludedFromBuild>
</ClInclude>
- <ClInclude Include="..\..\xbmc\filesystem\FileUPnP.h" />
<ClCompile Include="..\..\xbmc\ThumbLoader.cpp" />
<ClCompile Include="..\..\xbmc\ThumbnailCache.cpp" />
<ClCompile Include="..\..\xbmc\URL.cpp" />
View
9 project/VS2010Express/XBMC.vcxproj.filters
@@ -4996,12 +4996,6 @@
<ClInclude Include="..\..\xbmc\filesystem\DirectoryHistory.h">
<Filter>filesystem</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\filesystem\DllHDHomeRunDirectory.h">
- <Filter>filesystem</Filter>
- </ClInclude>
- <ClInclude Include="..\..\xbmc\filesystem\DllHDHomeRunFile.h">
- <Filter>filesystem</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\filesystem\DllLibAfp.h">
<Filter>filesystem</Filter>
</ClInclude>
@@ -5514,9 +5508,6 @@
<ClInclude Include="..\..\xbmc\dbwrappers\sqlitedataset.h">
<Filter>dbwrappers</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\filesystem\FileUPnP.h">
- <Filter>filesystem</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\system_gl.h" />
<ClInclude Include="..\..\xbmc\PlayListPlayer.h" />
<ClInclude Include="..\..\xbmc\BackgroundInfoLoader.h" />
View
54 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioDevice.cpp
@@ -245,14 +245,14 @@ std::string CCoreAudioDevice::GetName()
propertyAddress.mSelector = kAudioDevicePropertyDeviceName;
UInt32 propertySize;
- OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
+ OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
if (ret != noErr)
return NULL;
std::string name = "";
char *buff = new char[propertySize + 1];
buff[propertySize] = 0x00;
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, buff);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, buff);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::GetName: "
@@ -281,12 +281,12 @@ UInt32 CCoreAudioDevice::GetTotalOutputChannels()
propertyAddress.mSelector = kAudioDevicePropertyStreamConfiguration;
UInt32 size = 0;
- OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &size);
+ OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &size);
if (ret != noErr)
return channels;
AudioBufferList* pList = (AudioBufferList*)malloc(size);
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, pList);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, pList);
if (ret == noErr)
{
for(UInt32 buffer = 0; buffer < pList->mNumberBuffers; ++buffer)
@@ -317,13 +317,13 @@ bool CCoreAudioDevice::GetStreams(AudioStreamIdList* pList)
propertyAddress.mSelector = kAudioDevicePropertyStreams;
UInt32 propertySize = 0;
- OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
+ OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
if (ret != noErr)
return false;
UInt32 streamCount = propertySize / sizeof(AudioStreamID);
AudioStreamID* pStreamList = new AudioStreamID[streamCount];
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pStreamList);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pStreamList);
if (ret == noErr)
{
for (UInt32 stream = 0; stream < streamCount; stream++)
@@ -344,7 +344,7 @@ bool CCoreAudioDevice::IsRunning()
UInt32 isRunning = 0;
UInt32 propertySize = sizeof(isRunning);
- OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &isRunning);
+ OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &isRunning);
if (ret != noErr)
return false;
@@ -371,7 +371,13 @@ bool CCoreAudioDevice::SetHogStatus(bool hog)
{
CLog::Log(LOGDEBUG, "CCoreAudioDevice::SetHogStatus: "
"Setting 'hog' status on device 0x%04x", (unsigned int)m_DeviceId);
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(m_HogPid), &m_HogPid);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(m_HogPid), &m_HogPid);
+
+ // even if setting hogmode was successfull our PID might not get written
+ // into m_HogPid (so it stays -1). Readback hogstatus for judging if we
+ // had success on getting hog status
+ m_HogPid = GetHogStatus();
+
if (ret || m_HogPid != getpid())
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetHogStatus: "
@@ -390,7 +396,7 @@ bool CCoreAudioDevice::SetHogStatus(bool hog)
CLog::Log(LOGDEBUG, "CCoreAudioDevice::SetHogStatus: "
"Releasing 'hog' status on device 0x%04x", (unsigned int)m_DeviceId);
pid_t hogPid = -1;
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(hogPid), &hogPid);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(hogPid), &hogPid);
if (ret || hogPid == getpid())
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetHogStatus: "
@@ -416,7 +422,7 @@ pid_t CCoreAudioDevice::GetHogStatus()
pid_t hogPid = -1;
UInt32 size = sizeof(hogPid);
- AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, &hogPid);
+ AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, &hogPid);
return hogPid;
}
@@ -444,7 +450,7 @@ bool CCoreAudioDevice::SetMixingSupport(UInt32 mix)
UInt32 mixEnable = mix ? 1 : 0;
CLog::Log(LOGDEBUG, "CCoreAudioDevice::SetMixingSupport: "
"%sabling mixing for device 0x%04x", mix ? "En" : "Dis", (unsigned int)m_DeviceId);
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(mixEnable), &mixEnable);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(mixEnable), &mixEnable);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetMixingSupport: "
@@ -481,7 +487,7 @@ bool CCoreAudioDevice::GetMixingSupport()
if (writable)
{
size = sizeof(mix);
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, &mix);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &size, &mix);
if (ret != noErr)
mix = 0;
}
@@ -502,7 +508,7 @@ bool CCoreAudioDevice::SetCurrentVolume(Float32 vol)
propertyAddress.mElement = 0;
propertyAddress.mSelector = kHALOutputParam_Volume;
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(Float32), &vol);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(Float32), &vol);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetCurrentVolume: "
@@ -523,12 +529,12 @@ bool CCoreAudioDevice::GetPreferredChannelLayout(CCoreAudioChannelLayout& layout
propertyAddress.mSelector = kAudioDevicePropertyPreferredChannelLayout;
UInt32 propertySize = 0;
- OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
+ OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
if (ret)
return false;
void* pBuf = malloc(propertySize);
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pBuf);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pBuf);
if (ret != noErr)
CLog::Log(LOGERROR, "CCoreAudioDevice::GetPreferredChannelLayout: "
"Unable to retrieve preferred channel layout. Error = %s", GetError(ret).c_str());
@@ -552,13 +558,13 @@ bool CCoreAudioDevice::GetDataSources(CoreAudioDataSourceList* pList)
propertyAddress.mSelector = kAudioDevicePropertyDataSources;
UInt32 propertySize = 0;
- OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
+ OSStatus ret = AudioObjectGetPropertyDataSize(m_DeviceId, &propertyAddress, 0, NULL, &propertySize);
if (ret != noErr)
return false;
UInt32 sources = propertySize / sizeof(UInt32);
UInt32* pSources = new UInt32[sources];
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pSources);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, pSources);
if (ret == noErr)
{
for (UInt32 i = 0; i < sources; i++)
@@ -580,7 +586,7 @@ Float64 CCoreAudioDevice::GetNominalSampleRate()
Float64 sampleRate = 0.0f;
UInt32 propertySize = sizeof(Float64);
- OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &sampleRate);
+ OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &sampleRate);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::GetNominalSampleRate: "
@@ -604,7 +610,7 @@ bool CCoreAudioDevice::SetNominalSampleRate(Float64 sampleRate)
propertyAddress.mElement = 0;
propertyAddress.mSelector = kAudioDevicePropertyNominalSampleRate;
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(Float64), &sampleRate);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, sizeof(Float64), &sampleRate);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetNominalSampleRate: "
@@ -635,19 +641,19 @@ UInt32 CCoreAudioDevice::GetNumLatencyFrames()
UInt32 i_param = 0;
UInt32 i_param_size = sizeof(uint32_t);
- OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
+ OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
if (ret == noErr)
num_latency_frames += i_param;
// number of frames in the IO buffers
propertyAddress.mSelector = kAudioDevicePropertyBufferFrameSize;
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
if (ret == noErr)
num_latency_frames += i_param;
// number for frames in ahead the current hardware position that is safe to do IO
propertyAddress.mSelector = kAudioDevicePropertySafetyOffset;
- ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
+ ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &i_param_size, &i_param);
if (ret == noErr)
num_latency_frames += i_param;
@@ -666,7 +672,7 @@ UInt32 CCoreAudioDevice::GetBufferSize()
UInt32 size = 0;
UInt32 propertySize = sizeof(size);
- OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &size);
+ OSStatus ret = AudioObjectGetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, &propertySize, &size);
if (ret != noErr)
CLog::Log(LOGERROR, "CCoreAudioDevice::GetBufferSize: "
"Unable to retrieve buffer size. Error = %s", GetError(ret).c_str());
@@ -684,7 +690,7 @@ bool CCoreAudioDevice::SetBufferSize(UInt32 size)
propertyAddress.mSelector = kAudioDevicePropertyBufferFrameSize;
UInt32 propertySize = sizeof(size);
- OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, propertySize, &size);
+ OSStatus ret = AudioObjectSetPropertyData(m_DeviceId, &propertyAddress, 0, NULL, propertySize, &size);
if (ret != noErr)
{
CLog::Log(LOGERROR, "CCoreAudioDevice::SetBufferSize: "
View
4 xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -525,6 +525,10 @@ void CSoftAE::LoadSettings()
case 10: m_stdChLayout = AE_CH_LAYOUT_7_1; break;
}
+ // force optical/coax to 2.0 output channels
+ if (!m_rawPassthrough && g_guiSettings.GetInt("audiooutput.mode") == AUDIO_IEC958)
+ m_stdChLayout = AE_CH_LAYOUT_2_0;
+
/* get the output devices and ensure they exist */
m_device = g_guiSettings.GetString("audiooutput.audiodevice");
m_passthroughDevice = g_guiSettings.GetString("audiooutput.passthroughdevice");
View
75 xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp
@@ -31,7 +31,7 @@
#include <sys/ioctl.h>
-#if defined(OSS4) || defined(__FreeBSD__)
+#if defined(OSS4) || defined(TARGET_FREEBSD)
#include <sys/soundcard.h>
#else
#include <linux/soundcard.h>
@@ -239,46 +239,34 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device)
return false;
}
-#ifndef OSS4
-#ifndef __FreeBSD__
- int mask = 0;
- for (unsigned int i = 0; i < format.m_channelLayout.Count(); ++i)
- switch (format.m_channelLayout[i])
+ /* find the number we need to open to access the channels we need */
+ bool found = false;
+ int oss_ch = 0;
+ for (int ch = format.m_channelLayout.Count(); ch < 9; ++ch)
+ {
+ oss_ch = ch;
+ if (ioctl(m_fd, SNDCTL_DSP_CHANNELS, &oss_ch) != -1 && oss_ch >= (int)format.m_channelLayout.Count())
{
- case AE_CH_FL:
- case AE_CH_FR:
- mask |= DSP_BIND_FRONT;
- break;
-
- case AE_CH_BL:
- case AE_CH_BR:
- mask |= DSP_BIND_SURR;
- break;
-
- case AE_CH_FC:
- case AE_CH_LFE:
- mask |= DSP_BIND_CENTER_LFE;
- break;
-
- default:
- break;
+ found = true;
+ break;
}
+ }
- /* try to set the channel mask, not all cards support this */
- if (ioctl(m_fd, SNDCTL_DSP_BIND_CHANNEL, &mask) == -1)
+ if (!found)
+ CLog::Log(LOGWARNING, "CAESinkOSS::Initialize - Failed to access the number of channels required, falling back");
+
+#if defined(TARGET_FREEBSD)
+ /* fix hdmi 8 channels order */
+ if (!AE_IS_RAW(format.m_dataFormat) && 8 == oss_ch)
{
- CLog::Log(LOGWARNING, "CAESinkOSS::Initialize - Failed to set the channel mask");
- /* get the configured channel mask */
- if (ioctl(m_fd, SNDCTL_DSP_GETCHANNELMASK, &mask) == -1)
- {
- /* as not all cards support this so we just assume stereo if it fails */
- CLog::Log(LOGWARNING, "CAESinkOSS::Initialize - Failed to get the channel mask, assuming stereo");
- mask = DSP_BIND_FRONT;
- }
+ unsigned long long order = 0x0000000087346521ULL;
+
+ if (ioctl(m_fd, SNDCTL_DSP_SET_CHNORDER, &order) == -1)
+ CLog::Log(LOGWARNING, "CAESinkOSS::Initialize - Failed to set the channel order");
}
-#endif
-#else /* OSS4 */
+#elif defined(OSS4)
unsigned long long order = 0;
+
for (unsigned int i = 0; i < format.m_channelLayout.Count(); ++i)
switch (format.m_channelLayout[i])
{
@@ -303,25 +291,8 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device)
order = CHNORDER_NORMAL;
}
}
-
#endif
- /* find the number we need to open to access the channels we need */
- bool found = false;
- int oss_ch = 0;
- for (int ch = format.m_channelLayout.Count(); ch < 9; ++ch)
- {
- oss_ch = ch;
- if (ioctl(m_fd, SNDCTL_DSP_CHANNELS, &oss_ch) != -1 && oss_ch >= (int)format.m_channelLayout.Count())
- {
- found = true;
- break;
- }
- }
-
- if (!found)
- CLog::Log(LOGWARNING, "CAESinkOSS::Initialize - Failed to access the number of channels required, falling back");
-
int tmp = (CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3) * format.m_channelLayout.Count() * OSS_FRAMES;
int pos = 0;
while ((tmp & 0x1) == 0x0)
View
5 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -1166,6 +1166,9 @@ void CDVDPlayer::Process()
if(next == CDVDInputStream::NEXTSTREAM_OPEN)
{
SAFE_DELETE(m_pDemuxer);
+ m_CurrentAudio.stream = NULL;
+ m_CurrentVideo.stream = NULL;
+ m_CurrentSubtitle.stream = NULL;
continue;
}
@@ -3310,6 +3313,8 @@ int CDVDPlayer::OnDVDNavResult(void* pData, int iMessage)
m_SelectionStreams.Clear(STREAM_NONE, STREAM_SOURCE_NAV);
m_SelectionStreams.Update(m_pInputStream, m_pDemuxer);
+
+ return NAVRESULT_HOLD;
}
break;
case DVDNAV_CELL_CHANGE:
View
32 xbmc/video/dialogs/GUIDialogFileStacking.cpp
@@ -53,19 +53,6 @@ bool CGUIDialogFileStacking::OnMessage(CGUIMessage& message)
{
CGUIDialog::OnMessage(message);
m_iSelectedFile = -1;
- if (GetControl(STACK_LIST))
- { // have the new stack list instead - fill it up
- SendMessage(GUI_MSG_LABEL_RESET, GetID(), STACK_LIST);
- for (int i = 0; i < m_iNumberOfFiles; i++)
- {
- CStdString label;
- label.Format(g_localizeStrings.Get(23051).c_str(), i+1);
- CFileItemPtr item(new CFileItem(label));
- m_stackItems->Add(item);
- }
- CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), STACK_LIST, 0, 0, m_stackItems);
- OnMessage(msg);
- }
return true;
}
break;
@@ -97,3 +84,22 @@ void CGUIDialogFileStacking::SetNumberOfFiles(int iFiles)
{
m_iNumberOfFiles = iFiles;
}
+
+void CGUIDialogFileStacking::OnInitWindow()
+{
+ if (GetControl(STACK_LIST))
+ {
+ // have the new stack list instead - fill it up
+ SendMessage(GUI_MSG_LABEL_RESET, GetID(), STACK_LIST);
+ for (int i = 0; i < m_iNumberOfFiles; i++)
+ {
+ CStdString label;
+ label.Format(g_localizeStrings.Get(23051).c_str(), i+1);
+ CFileItemPtr item(new CFileItem(label));
+ m_stackItems->Add(item);
+ }
+ CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), STACK_LIST, 0, 0, m_stackItems);
+ OnMessage(msg);
+ }
+ CGUIDialog::OnInitWindow();
+}
View
1  xbmc/video/dialogs/GUIDialogFileStacking.h
@@ -36,6 +36,7 @@ class CGUIDialogFileStacking :
int GetSelectedFile() const;
void SetNumberOfFiles(int iFiles);
protected:
+ virtual void OnInitWindow();
int m_iSelectedFile;
int m_iNumberOfFiles;
CFileItemList* m_stackItems;
Please sign in to comment.
Something went wrong with that request. Please try again.