summaryrefslogtreecommitdiff
path: root/multimedia/mplayer-share/patches/patch-an
blob: d53a6e2a62f8145f8d74f61d0b17aee055975bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$NetBSD: patch-an,v 1.4 2012/06/11 21:55:34 wiz Exp $

http://bugzilla.mplayerhq.hu/show_bug.cgi?id=751

Please also see: pkg/20549.

--- stream/vcd_read_fbsd.h.orig	2011-05-07 21:32:50.000000000 +0000
+++ stream/vcd_read_fbsd.h
@@ -63,9 +63,8 @@ typedef struct mp_vcd_priv_st {
   vcd_tocentry entry;
 #ifdef VCD_NETBSD
   struct cd_toc_entry entry_data;
-#else
-  cdsector_t buf;
 #endif
+  cdsector_t buf;
   struct ioc_toc_header tochdr;
 } mp_vcd_priv_t;
 
@@ -236,8 +235,8 @@ vcd_read(mp_vcd_priv_t* vcd, char *mem)
   sc.cmd[9] = 1 << 4; // user data only
   sc.cmd[10] = 0;     // no subchannel
   sc.cmdlen = 12;
-  sc.databuf = (caddr_t) mem;
-  sc.datalen = VCD_SECTOR_DATA;
+  sc.databuf = (caddr_t) vcd->buf.data;
+  sc.datalen = VCD_SECTOR_DATA + 4;    // MMC-3 spec says there are 4 extra bytes
   sc.senselen = sizeof(sc.sense);
   sc.flags = SCCMD_READ;
   sc.timeout = 10000;
@@ -254,9 +253,9 @@ vcd_read(mp_vcd_priv_t* vcd, char *mem)
 #else
   if (pread(vcd->fd,&vcd->buf,VCD_SECTOR_SIZE,vcd_get_msf(vcd)*VCD_SECTOR_SIZE)
      != VCD_SECTOR_SIZE) return 0;  // EOF?
+#endif
 
   memcpy(mem,vcd->buf.data,VCD_SECTOR_DATA);
-#endif
   vcd_inc_msf(vcd);
   return VCD_SECTOR_DATA;
 }