diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-17 18:49:33 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-17 18:49:33 +0000 |
commit | 77d7b8c9e00a718553d5a2bafb5dcc4e73c56ee6 (patch) | |
tree | 41f1c53aee65f33cc23920d49b4b716805bd2e30 /stream | |
parent | e40792bf0e03e4848ab4fbe419299144bbef9b63 (diff) | |
download | mpv-77d7b8c9e00a718553d5a2bafb5dcc4e73c56ee6.tar.bz2 mpv-77d7b8c9e00a718553d5a2bafb5dcc4e73c56ee6.tar.xz |
Move the zeroing directly before the other initialization code
for the array/struct
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25074 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_dvd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index e6ca1a4a3d..d2cf295c14 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -55,10 +55,7 @@ static void dvd_set_speed(char *device, unsigned speed) struct sg_io_hdr sghdr; struct stat st; - memset(&sghdr, 0, sizeof(sghdr)); - memset(buffer, 0, sizeof(buffer)); memset(sense, 0, sizeof(sense)); - memset(cmd, 0, sizeof(cmd)); memset(&st, 0, sizeof(st)); if (stat(device, &st) == -1) return; @@ -80,6 +77,7 @@ static void dvd_set_speed(char *device, unsigned speed) break; } + memset(&sghdr, 0, sizeof(sghdr)); sghdr.interface_id = 'S'; sghdr.timeout = 5000; sghdr.dxfer_direction = SG_DXFER_TO_DEV; @@ -90,9 +88,11 @@ static void dvd_set_speed(char *device, unsigned speed) sghdr.dxferp = buffer; sghdr.cmdp = cmd; + memset(cmd, 0, sizeof(cmd)); cmd[0] = GPCMD_SET_STREAMING; cmd[10] = sizeof(buffer); + memset(buffer, 0, sizeof(buffer)); /* first sector 0, last sector 0xffffffff */ AV_WB32(buffer + 8, 0xffffffff); |