diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-30 15:53:50 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-07-30 15:53:50 +0000 |
commit | 317fbd89058afc34989519beab42eb60a59d0b69 (patch) | |
tree | 5df0d9c8a2e0fa03b1b923dc407ce4d8e5dec369 /stream | |
parent | 0ce80b61cbc7d6c79a82387fa5aab5d4c1e2d3aa (diff) | |
download | mpv-317fbd89058afc34989519beab42eb60a59d0b69.tar.bz2 mpv-317fbd89058afc34989519beab42eb60a59d0b69.tar.xz |
Simplify sun SCSI command generation
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23940 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/vcd_read.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/stream/vcd_read.h b/stream/vcd_read.h index 9c7bdc6a3c..422073344a 100644 --- a/stream/vcd_read.h +++ b/stream/vcd_read.h @@ -1,3 +1,4 @@ +#include "libavutil/intreadwrite.h" //=================== VideoCD ========================== #if defined(linux) || defined(sun) || defined(__bsdi__) @@ -185,36 +186,15 @@ static int sun_vcd_read(mp_vcd_priv_t* vcd, int *offset) union scsi_cdb cdb; int lba = vcd_get_msf(vcd); int blocks = 1; - int sector_type; - int sync, header_code, user_data, edc_ecc, error_field; - int sub_channel; - - /* sector_type = 3; *//* mode2 */ - sector_type = 5; /* mode2/form2 */ - sync = 0; - header_code = 0; - user_data = 1; - edc_ecc = 0; - error_field = 0; - sub_channel = 0; memset(&cdb, 0, sizeof(cdb)); memset(&sc, 0, sizeof(sc)); cdb.scc_cmd = 0xBE; - cdb.cdb_opaque[1] = (sector_type) << 2; - cdb.cdb_opaque[2] = (lba >> 24) & 0xff; - cdb.cdb_opaque[3] = (lba >> 16) & 0xff; - cdb.cdb_opaque[4] = (lba >> 8) & 0xff; - cdb.cdb_opaque[5] = lba & 0xff; - cdb.cdb_opaque[6] = (blocks >> 16) & 0xff; - cdb.cdb_opaque[7] = (blocks >> 8) & 0xff; - cdb.cdb_opaque[8] = blocks & 0xff; - cdb.cdb_opaque[9] = (sync << 7) | - (header_code << 5) | - (user_data << 4) | - (edc_ecc << 3) | - (error_field << 1); - cdb.cdb_opaque[10] = sub_channel; + cdb.cdb_opaque[1] = 5 << 2; // mode2 / form2 + AV_WB32(&cdb.cdb_opaque[2], lba); + AV_WB24(&cdb.cdb_opaque[6], blocks); + cdb.cdb_opaque[9] = 1 << 4; // user data only + cdb.cdb_opaque[10] = 0; // subchannel sc.uscsi_cdb = (caddr_t)&cdb; sc.uscsi_cdblen = 12; |