Skip to content

Commit

Permalink
Merge pull request #7449 from un1versal/xbox-cleanup
Browse files Browse the repository at this point in the history
[cleanup] remove more xbox related things tidy up slightly
  • Loading branch information
mkortstiege committed Oct 3, 2015
2 parents 7aeff92 + 854ab5e commit 1308f6a
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 117 deletions.
17 changes: 8 additions & 9 deletions xbmc/storage/DetectDVDType.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
* Copyright (C) 2005-2015 Team XBMC
* http://kodi.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
Expand Down Expand Up @@ -150,12 +150,12 @@ VOID CDetectDVDMedia::UpdateDvdrom()

case DRIVE_NOT_READY:
{
// drive is not ready (closing, opening)
// Drive is not ready (closing, opening)
m_isoReader.Reset();
SetNewDVDShareUrl("D:\\", false, g_localizeStrings.Get(503));
m_DriveState = DRIVE_NOT_READY;
// DVD-ROM in undefined state
// better delete old CD Information
// Better delete old CD Information
if ( m_pCdInfo != NULL )
{
delete m_pCdInfo;
Expand All @@ -172,7 +172,7 @@ VOID CDetectDVDMedia::UpdateDvdrom()

case DRIVE_CLOSED_NO_MEDIA:
{
// nothing in there...
// Nothing in there...
m_isoReader.Reset();
SetNewDVDShareUrl("D:\\", false, g_localizeStrings.Get(504));
m_DriveState = DRIVE_CLOSED_NO_MEDIA;
Expand Down Expand Up @@ -251,7 +251,7 @@ void CDetectDVDMedia::DetectMediaType()
}
else
{
if (m_pCdInfo->IsUDF(1) || m_pCdInfo->IsUDFX(1))
if (m_pCdInfo->IsUDF(1))
strNewUrl = "D:\\";
else if (m_pCdInfo->IsAudio(1))
{
Expand Down Expand Up @@ -308,7 +308,7 @@ void CDetectDVDMedia::SetNewDVDShareUrl( const std::string& strNewUrl, bool bCDD

if (strDiscLabel != "") strDescription = strDiscLabel;

// store it in case others want it
// Store it in case others want it
m_diskLabel = strDescription;
m_diskPath = strNewUrl;
}
Expand Down Expand Up @@ -480,8 +480,7 @@ bool CDetectDVDMedia::IsDiscInDrive()

// Static function
// Returns a CCdInfo class, which contains
// Media information of the current
// inserted CD.
// Media information of the current inserted CD.
// Can be NULL
CCdInfo* CDetectDVDMedia::GetCdInfo()
{
Expand Down
11 changes: 4 additions & 7 deletions xbmc/storage/DetectDVDType.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
* Copyright (C) 2005-2015 Team XBMC
* http://kodi.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
Expand All @@ -20,13 +20,10 @@
*
*/

// CDetectDVDMedia - Thread running in the background to detect a CD change
// and the filesystem
// CDetectDVDMedia
// Thread running in the background to detect a CD change and the filesystem
//
// by Bobbin007 in 2003
//
//
//

#include "system.h"

Expand Down
54 changes: 22 additions & 32 deletions xbmc/storage/cdioSupport.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
* Copyright (C) 2005-2015 Team XBMC
* http://kodi.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
Expand Down Expand Up @@ -44,8 +44,7 @@ std::shared_ptr<CLibcdio> CLibcdio::m_pInstance;
#define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */
#define BOOT_SECTOR 17 /* buffer[3] */
#define VCD_INFO_SECTOR 150 /* buffer[4] */
#define UDFX_SECTOR 32 /* buffer[4] */
#define UDF_ANCHOR_SECTOR 256 /* buffer[5] */
#define UDF_ANCHOR_SECTOR 256 /* buffer[5] */


signature_t CCdIoSupport::sigs[] =
Expand All @@ -64,15 +63,14 @@ signature_t CCdIoSupport::sigs[] =
{3, 7, "EL TORITO", "BOOTABLE"},
{4, 0, "VIDEO_CD", "VIDEO CD"},
{4, 0, "SUPERVCD", "Chaoji VCD"},
{0, 0, "MICROSOFT*XBOX*MEDIA", "UDFX CD"},
{0, 1, "BEA01", "UDF"},
{ 0 }
};

#undef DEBUG_CDIO

static void
xbox_cdio_log_handler (cdio_log_level_t level, const char message[])
cdio_log_handler (cdio_log_level_t level, const char message[])
{
#ifdef DEBUG_CDIO
switch (level)
Expand Down Expand Up @@ -104,7 +102,7 @@ xbox_cdio_log_handler (cdio_log_level_t level, const char message[])
//////////////////////////////////////////////////////////////////////
CLibcdio::CLibcdio(): s_defaultDevice(NULL)
{
cdio_log_set_handler( xbox_cdio_log_handler );
cdio_log_set_handler( cdio_log_handler );
}

CLibcdio::~CLibcdio()
Expand Down Expand Up @@ -202,8 +200,8 @@ char* CLibcdio::GetDeviceFileName()
{
CSingleLock lock(*this);

// if we don't have a DVD device initially present (Darwin or a USB DVD drive),
// we have to keep checking in case one appears.
// If We don't have a DVD device initially present (Darwin or a USB DVD drive),
// We have to keep checking in case one appears.
if (s_defaultDevice && strlen(s_defaultDevice) == 0)
{
free(s_defaultDevice);
Expand Down Expand Up @@ -386,9 +384,6 @@ void CCdIoSupport::PrintAnalysis(int fs, int num_audio)
case FS_3DO:
CLog::Log(LOGINFO, "CD-ROM with Panasonic 3DO filesystem");
break;
case FS_UDFX:
CLog::Log(LOGINFO, "CD-ROM with UDFX filesystem");
break;
case FS_UNKNOWN:
CLog::Log(LOGINFO, "CD-ROM with unknown filesystem");
break;
Expand Down Expand Up @@ -607,11 +602,6 @@ int CCdIoSupport::GuessFilesystem(int start_session, track_t track_num)
ret = FS_EXT2;
break;

case CDIO_FS_UDFX:
ret = FS_UDFX;
udf = true;
break;

case CDIO_FS_UDF:
ret = FS_UDF;
udf = true;
Expand Down Expand Up @@ -661,7 +651,7 @@ void CCdIoSupport::GetCdTextInfo(xbmc_cdtext_t &xcdt, int trackNum)
if (cdtext_get_const(pcdtext, (cdtext_field_t)i, trackNum))
xcdt[(cdtext_field_t)i] = cdtext_field2str((cdtext_field_t)i);
#else
// same ids used in libcdio and for our structure + the ids are consecutive make this copy loop safe.
// Same ids used in libcdio and for our structure + the ids are consecutive make this copy loop safe.
for (int i = 0; i < MAX_CDTEXT_FIELDS; i++)
if (pcdtext->field[i])
xcdt[(cdtext_field_t)i] = pcdtext->field[(cdtext_field_t)i];
Expand Down Expand Up @@ -744,11 +734,11 @@ CCdInfo* CCdIoSupport::GetCdInfo(char* cDeviceFileName)
m_nFs = FS_NO_DATA;
int temp1 = ::cdio_get_track_lba(cdio, i) - CDIO_PREGAP_SECTORS;
int temp2 = ::cdio_get_track_lba(cdio, i + 1) - CDIO_PREGAP_SECTORS;
// the length is the address of the second track minus the address of the first track
temp2 -= temp1; // temp2 now has length of track1 in frames
// The length is the address of the second track minus the address of the first track
temp2 -= temp1; // temp2 now has length of track1 in frames
ti.nMins = temp2 / (60 * 75); // calculate the number of minutes
temp2 %= 60 * 75; // calculate the left-over frames
ti.nSecs = temp2 / 75; // calculate the number of seconds
temp2 %= 60 * 75; // calculate the left-over frames
ti.nSecs = temp2 / 75; // calculate the number of seconds
if ( -1 == m_nFirstAudio)
m_nFirstAudio = i;

Expand Down Expand Up @@ -794,7 +784,7 @@ CCdInfo* CCdIoSupport::GetCdInfo(char* cDeviceFileName)
CLog::Log(LOGINFO, "CD Analysis Report");
CLog::Log(LOGINFO, STRONG);

/* try to find out what sort of CD we have */
/* Try to find out what sort of CD we have */
if (0 == m_nNumData)
{
/* no data track, may be a "real" audio CD or hidden track CD */
Expand All @@ -819,7 +809,7 @@ CCdInfo* CCdIoSupport::GetCdInfo(char* cDeviceFileName)
}
else
{
/* we have data track(s) */
/* We have data track(s) */
for (j = 2, i = m_nFirstData; i <= m_nNumTracks; i++)
{
msf_t msf;
Expand Down Expand Up @@ -853,11 +843,11 @@ CCdInfo* CCdIoSupport::GetCdInfo(char* cDeviceFileName)

m_nStartTrack = (i == 1) ? 0 : ::cdio_msf_to_lsn(&msf);

/* save the start of the data area */
/* Save the start of the data area */
if (i == m_nFirstData)
m_nDataStart = m_nStartTrack;

/* skip tracks which belong to the current walked session */
/* Skip tracks which belong to the current walked session */
if (m_nStartTrack < m_nDataStart + m_nIsofsSize)
continue;

Expand All @@ -875,7 +865,7 @@ CCdInfo* CCdIoSupport::GetCdInfo(char* cDeviceFileName)

if (i > 1)
{
/* track is beyond last session -> new session found */
/* Track is beyond last session -> new session found */
m_nMsOffset = m_nStartTrack;

CLog::Log(LOGINFO, "Session #%d starts at track %2i, LSN: %6i,"
Expand Down Expand Up @@ -924,11 +914,11 @@ UINT CCdIoSupport::MsfSeconds(msf_t *msf)
}


// Compute the CDDB disk ID for an Audio disk. This is a funny checksum
// consisting of the concatenation of 3 things:
// the sum of the decimal digits of sizes of all tracks,
// the total length of the disk, and
// the number of tracks.
// Compute the CDDB disk ID for an Audio disk.
// This is a funny checksum consisting of the concatenation of 3 things:
// The sum of the decimal digits of sizes of all tracks,
// The total length of the disk, and
// The number of tracks.

uint32_t CCdIoSupport::CddbDiscId()
{
Expand Down
Loading

0 comments on commit 1308f6a

Please sign in to comment.