aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-17 18:46:52 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-17 18:46:52 +0000
commite40792bf0e03e4848ab4fbe419299144bbef9b63 (patch)
tree662ff490523348b1398874eddadd8ad2f81235ae
parentd9f35323fa8430b67c471877d4a06d108f618fc1 (diff)
Move everything that sets buffer values together.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25073 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--stream/stream_dvd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 029676c112..e6ca1a4a3d 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -70,8 +70,6 @@ static void dvd_set_speed(char *device, unsigned speed)
return;
case -1: /* restore default value */
if (dvd_speed == 0) return; /* we haven't touched the speed setting */
- speed = 0;
- buffer[0] = 4; /* restore default */
mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDrestoreSpeed);
break;
default: /* limit to <speed> KB/s */
@@ -98,9 +96,13 @@ static void dvd_set_speed(char *device, unsigned speed)
/* first sector 0, last sector 0xffffffff */
AV_WB32(buffer + 8, 0xffffffff);
+ if (speed == -1)
+ buffer[0] = 4; /* restore default */
+ else {
/* <speed> kilobyte */
AV_WB32(buffer + 12, speed);
AV_WB32(buffer + 20, speed);
+ }
/* 1 second */
AV_WB16(buffer + 18, 1000);