Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 183666 Details for
Bug 260844
media-tv/xbmc stable ebuild request
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
xbmc-8.10_readsector.diff
xbmc-8.10_readsector.diff (text/plain), 2.85 KB, created by
Rick Harris
on 2009-03-02 10:43:24 UTC
(
hide
)
Description:
xbmc-8.10_readsector.diff
Filename:
MIME Type:
Creator:
Rick Harris
Created:
2009-03-02 10:43:24 UTC
Size:
2.85 KB
patch
obsolete
>diff -Naur xbmc.orig/xbmc/xbox/IoSupport.cpp xbmc/xbmc/xbox/IoSupport.cpp >--- xbmc.orig/xbmc/xbox/IoSupport.cpp 2008-12-07 23:17:19.000000000 +0100 >+++ xbmc/xbmc/xbox/IoSupport.cpp 2008-12-07 23:31:17.000000000 +0100 >@@ -40,6 +40,7 @@ > #include <linux/limits.h> > #include <sys/types.h> > #include <sys/ioctl.h> >+#include <unistd.h> > #include <fcntl.h> > #include <linux/cdrom.h> > #endif >@@ -445,37 +446,31 @@ > if (hDevice->m_bCDROM) > { > int fd = hDevice->fd; >- int lba = (dwSector + CD_MSF_OFFSET) ; >- int m,s,f; >- union >- { >- struct cdrom_msf msf; >- char buffer[2356]; >- } arg; > >- // convert sector offset to minute, second, frame format >- // since that is what the 'ioctl' requires as input >- f = lba % CD_FRAMES; >- lba /= CD_FRAMES; >- s = lba % CD_SECS; >- lba /= CD_SECS; >- m = lba; >+ // seek to requested sector >+ if (lseek(fd, dwSector * MODE1_DATA_SIZE, SEEK_SET) < 0) >+ { >+ CLog::Log(LOGERROR, "CD: ReadSector Request to read sector %d\n", (int)dwSector); >+ CLog::Log(LOGERROR, "CD: ReadSector error: %s\n", strerror(errno)); >+ OutputDebugString("CD Read error\n"); >+ return (-1); >+ } > >- arg.msf.cdmsf_min0 = m; >- arg.msf.cdmsf_sec0 = s; >- arg.msf.cdmsf_frame0 = f; >- >- int ret = ioctl(fd, CDROMREADMODE1, &arg); >- if (ret==0) >+ // read data block of this sector >+ while (read(fd, lpczBuffer, MODE1_DATA_SIZE) < 0) > { >- memcpy(lpczBuffer, arg.buffer, 2048); >- return 2048; >+ // read was interrupted - try again >+ if (errno == EINTR) >+ continue; >+ >+ // error reading sector >+ CLog::Log(LOGERROR, "CD: ReadSector Request to read sector %d\n", (int)dwSector); >+ CLog::Log(LOGERROR, "CD: ReadSector error: %s\n", strerror(errno)); >+ OutputDebugString("CD Read error\n"); >+ return (-1); > } >- CLog::Log(LOGERROR, "CD: ReadSector Request to read sector %d\n", (int)dwSector); >- CLog::Log(LOGERROR, "CD: ReadSector error: %s\n", strerror(errno)); >- CLog::Log(LOGERROR, "CD: ReadSector minute %d, second %d, frame %d\n", m, s, f); >- OutputDebugString("CD Read error\n"); >- return -1; >+ >+ return MODE1_DATA_SIZE; > } > #endif > LARGE_INTEGER Displacement; >diff -Naur xbmc.orig/xbmc/xbox/IoSupport.h xbmc/xbmc/xbox/IoSupport.h >--- xbmc.orig/xbmc/xbox/IoSupport.h 2008-12-07 23:17:19.000000000 +0100 >+++ xbmc/xbmc/xbox/IoSupport.h 2008-12-07 23:31:17.000000000 +0100 >@@ -40,6 +40,8 @@ > #define DRIVE_CLOSED_MEDIA_PRESENT 4 // Will be send once when the drive just have closed > #define DRIVE_NONE 5 // system doesn't have an optical drive > >+#define MODE1_DATA_SIZE 2048 // Mode1 sector has 2048 bytes of data >+ > #define MODE2_DATA_START 24 // Mode2 raw sector has 24 bytes before the data payload > #define MODE2_DATA_SIZE 2324 // And has 2324 usable bytes > #define RAW_SECTOR_SIZE 2352 // Raw sector size
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260844
:
183660
| 183666