Permalink
Browse files

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

  • Loading branch information...
2 parents 27ada40 + 4f9f8e7 commit 9806b400933b5b8569af363ed2416043ba5dec4d @opdenkamp committed Aug 31, 2012
@@ -85,10 +85,11 @@ struct sampleFormat
AEDataFormat subFormatType;
};
-//Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> 16 bit int
+//Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> -> 24 bit int -> 16 bit int
static const sampleFormat testFormats[] = { {KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, AE_FMT_FLOAT},
{KSDATAFORMAT_SUBTYPE_PCM, 32, 32, AE_FMT_S32NE},
{KSDATAFORMAT_SUBTYPE_PCM, 32, 24, AE_FMT_S24NE4},
+ {KSDATAFORMAT_SUBTYPE_PCM, 24, 24, AE_FMT_S24NE3},
{KSDATAFORMAT_SUBTYPE_PCM, 16, 16, AE_FMT_S16NE} };
struct winEndpointsToAEDeviceType
@@ -65,10 +65,6 @@ CStdString CDirectoryNodeOverview::GetLocalizedName() const
bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
{
- CVideoDbUrl videoUrl;
- if (!videoUrl.FromString(BuildPath()))
- return false;
-
CVideoDatabase database;
database.Open();
bool hasMovies = database.HasContent(VIDEODB_CONTENT_MOVIES);
@@ -105,14 +101,10 @@ bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
if (hasMusicVideos)
vec.push_back(make_pair("6", 20390)); // Recently Added Music Videos
}
-
+ CStdString path = BuildPath();
for (unsigned int i = 0; i < vec.size(); ++i)
{
- CVideoDbUrl itemUrl = videoUrl;
- CStdString strDir; strDir.Format("%s/", vec[i].first);
- itemUrl.AppendPath(strDir);
-
- CFileItemPtr pItem(new CFileItem(itemUrl.ToString()));
+ CFileItemPtr pItem(new CFileItem(path + vec[i].first + "/", true));
pItem->SetLabel(g_localizeStrings.Get(vec[i].second));
pItem->SetLabelPreformated(true);
pItem->SetCanQueue(false);
@@ -100,7 +100,11 @@ void CMediaManager::Initialize()
#endif
}
#ifdef HAS_DVD_DRIVE
- strFirstAvailDrive = MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName();
+#if defined(TARGET_WINDOWS)
+ m_strFirstAvailDrive = CWIN32Util::GetFirstOpticalDrive();
+#else
+ m_strFirstAvailDrive = MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName();
+#endif
#endif
m_platformStorage->Initialize();
}
@@ -308,7 +312,7 @@ CStdString CMediaManager::TranslateDevicePath(const CStdString& devicePath, bool
// fallback for cdda://local/ and empty devicePath
#ifdef HAS_DVD_DRIVE
if(devicePath.empty() || devicePath.Left(12).Compare("cdda://local")==0)
- strDevice = strFirstAvailDrive;
+ strDevice = m_strFirstAvailDrive;
#endif
#ifdef _WIN32
@@ -96,7 +96,7 @@ class CMediaManager : public IStorageEventsCallback, public IJobCallback
bool HashDVD(const CStdString& dvdpath, uint32_t& crc);
#endif
bool m_bhasoptical;
- CStdString strFirstAvailDrive;
+ CStdString m_strFirstAvailDrive;
private:
IStorageProvider *m_platformStorage;
@@ -24,6 +24,7 @@
#include "filesystem/SpecialProtocol.h"
#include "storage/MediaManager.h"
#include "utils/JobManager.h"
+#include "utils/log.h"
bool CWin32StorageProvider::xbevent = false;
@@ -34,6 +35,8 @@ void CWin32StorageProvider::Initialize()
CWIN32Util::GetDrivesByType(vShare, DVD_DRIVES);
if(!vShare.empty())
g_mediaManager.SetHasOpticalDrive(true);
+ else
+ CLog::Log(LOGDEBUG, "%s: No optical drive found.", __FUNCTION__);
// Can be removed once the StorageHandler supports optical media
VECSOURCES::const_iterator it;
@@ -88,6 +91,7 @@ CDetectDisc::CDetectDisc(const CStdString &strPath, const bool bautorun)
bool CDetectDisc::DoWork()
{
+ CLog::Log(LOGDEBUG, "%s: Optical media found in drive %s", __FUNCTION__, m_strPath.c_str());
CMediaSource share;
share.strPath = m_strPath;
share.strStatus = g_mediaManager.GetDiskLabel(share.strPath);
View
@@ -116,6 +116,8 @@ int CWIN32Util::GetDriveStatus(const CStdString &strPath, bool bStatusEx)
T_SPDT_SBUF sptd_sb; //SCSI Pass Through Direct variable.
byte DataBuf[8]; //Buffer for holding data to/from drive.
+ CLog::Log(LOGDEBUG, __FUNCTION__": Requesting status for drive %s.", strPath.c_str());
+
hDevice = CreateFile( strPath.c_str(), // drive
0, // no access to the drive
FILE_SHARE_READ, // share mode
@@ -126,6 +128,7 @@ int CWIN32Util::GetDriveStatus(const CStdString &strPath, bool bStatusEx)
if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive
{
+ CLog::Log(LOGERROR, __FUNCTION__": Failed to CreateFile for %s.", strPath.c_str());
return -1;
}
@@ -158,6 +161,7 @@ int CWIN32Util::GetDriveStatus(const CStdString &strPath, bool bStatusEx)
if (hDevice == INVALID_HANDLE_VALUE)
{
+ CLog::Log(LOGERROR, __FUNCTION__": Failed to CreateFile2 for %s.", strPath.c_str());
return -1;
}
@@ -883,6 +887,17 @@ void CWIN32Util::GetDrivesByType(VECSOURCES &localDrives, Drive_Types eDriveType
}
}
+std::string CWIN32Util::GetFirstOpticalDrive()
+{
+ VECSOURCES vShare;
+ std::string strdevice = "\\\\.\\";
+ CWIN32Util::GetDrivesByType(vShare, DVD_DRIVES);
+ if(!vShare.empty())
+ return strdevice.append(vShare.front().strPath);
+ else
+ return "";
+}
+
bool CWIN32Util::IsAudioCD(const CStdString& strPath)
{
CStdString strDrive = strPath;
View
@@ -73,6 +73,7 @@ class CWIN32Util
#endif
static BOOL IsCurrentUserLocalAdministrator();
static void GetDrivesByType(VECSOURCES &localDrives, Drive_Types eDriveType=ALL_DRIVES, bool bonlywithmedia=false);
+ static std::string GetFirstOpticalDrive();
static bool IsAudioCD(const CStdString& strPath);
static CStdString GetDiskLabel(const CStdString& strPath);

0 comments on commit 9806b40

Please sign in to comment.