summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-27 16:59:41 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-27 16:59:41 +0000
commitadce32de93c21c4693e6d694c6fdfc9b125a4206 (patch)
tree5d43535ac0cae32103f4422f2b9c0d7440438a39 /stream
parent37c39a9f74ee382f8b3817527af10b77c4351953 (diff)
downloadmpv-adce32de93c21c4693e6d694c6fdfc9b125a4206.tar.bz2
mpv-adce32de93c21c4693e6d694c6fdfc9b125a4206.tar.xz
Simplify NetBSD vcd_read code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23873 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/vcd_read_nbsd.h27
1 files changed, 6 insertions, 21 deletions
diff --git a/stream/vcd_read_nbsd.h b/stream/vcd_read_nbsd.h
index 30ce1bebd6..399963647b 100644
--- a/stream/vcd_read_nbsd.h
+++ b/stream/vcd_read_nbsd.h
@@ -3,6 +3,7 @@
#ifdef __NetBSD__
#include <sys/inttypes.h>
#endif
+#include "libavutil/intreadwrite.h"
#include <sys/cdio.h>
#include <sys/scsiio.h>
@@ -155,33 +156,17 @@ vcd_read(mp_vcd_priv_t* vcd, char *mem)
struct scsireq sc;
int lba = vcd_get_msf(vcd);
int blocks;
- int sector_type;
- int sync, header_code, user_data, edc_ecc, error_field;
- int sub_channel;
int rc;
blocks = 1;
- sector_type = 5; /* mode2/form2 */
- sync = 0;
- header_code = 0;
- user_data = 1;
- edc_ecc = 0;
- error_field = 0;
- sub_channel = 0;
memset(&sc, 0, sizeof(sc));
sc.cmd[0] = 0xBE;
- sc.cmd[1] = (sector_type) << 2;
- sc.cmd[2] = (lba >> 24) & 0xff;
- sc.cmd[3] = (lba >> 16) & 0xff;
- sc.cmd[4] = (lba >> 8) & 0xff;
- sc.cmd[5] = lba & 0xff;
- sc.cmd[6] = (blocks >> 16) & 0xff;
- sc.cmd[7] = (blocks >> 8) & 0xff;
- sc.cmd[8] = blocks & 0xff;
- sc.cmd[9] = (sync << 7) | (header_code << 5) | (user_data << 4) |
- (edc_ecc << 3) | (error_field << 1);
- sc.cmd[10] = sub_channel;
+ sc.cmd[1] = 5 << 2; // mode2/form2
+ AV_WB32(&sc.cmd[2], lba);
+ AV_WB24(&sc.cmd[6], blocks);
+ sc.cmd[9] = 1 << 4; // user data only
+ sc.cmd[10] = 0; // no subchannel
sc.cmdlen = 12;
sc.databuf = (caddr_t) mem;
sc.datalen = 2328;