Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 176344 Details for
Bug 198849
xbmc ebuild request
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
xbmc.readsector.patch
xbmc.readsector.patch (text/plain), 2.85 KB, created by
Rick Harris
on 2008-12-25 09:23:24 UTC
(
hide
)
Description:
xbmc.readsector.patch
Filename:
MIME Type:
Creator:
Rick Harris
Created:
2008-12-25 09:23: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 Raw
Actions:
View
Attachments on
bug 198849
:
154915
|
156499
|
158461
|
158463
|
159349
|
159791
|
160046
|
161074
|
161090
|
161453
|
161515
|
162061
|
165834
|
167750
|
167752
|
167754
|
169152
|
169154
|
170055
|
170640
|
170858
|
170976
|
171513
|
171625
|
171788
|
171958
|
173332
|
174353
|
175028
|
175034
|
175317
|
176341
| 176344 |
176346
|
176540
|
176956
|
177426
|
177427
|
182495
|
182498
|
182587
|
182692