aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--stream/stream_dvd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index cc831b5f96..b3c87a108d 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -65,11 +65,6 @@ static void dvd_set_speed(char *device, unsigned speed)
if (!S_ISBLK(st.st_mode)) return; /* not a block device */
- if ((fd = open(device, O_RDWR | O_NONBLOCK)) == -1) {
- mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDspeedCantOpen);
- return;
- }
-
if (speed < 100) { /* speed times 1350KB/s (DVD single speed) */
speed *= 1350;
}
@@ -114,6 +109,11 @@ static void dvd_set_speed(char *device, unsigned speed)
AV_WB16(buffer + 18, 1000);
AV_WB16(buffer + 26, 1000);
+ if ((fd = open(device, O_RDWR | O_NONBLOCK)) == -1) {
+ mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDspeedCantOpen);
+ return;
+ }
+
if (ioctl(fd, SG_IO, &sghdr) < 0) {
mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitFail);
} else