From 8f164e07a00a82b2a7cde6b617c896e35e4ee9e1 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 10 Nov 2009 23:10:57 +0000 Subject: Share dvd_device extern declaration between dvd and dvdnav. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29887 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 1 - 1 file changed, 1 deletion(-) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 4047e84080..d19ce1ce5e 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -41,7 +41,6 @@ #include "libmpdemux/demuxer.h" #include "libavutil/intreadwrite.h" -extern char* dvd_device; static char* dvd_device_current; int dvd_angle=1; int dvd_speed=0; /* 0 => don't touch speed */ -- cgit v1.2.3 From 36ec82183681b5c751026e2c2d121cb4bd5bc87b Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 10 Nov 2009 23:15:48 +0000 Subject: Move arrays used by both dvd and dvdnav to dvd_common. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29889 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index d19ce1ce5e..baa535500e 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -132,9 +132,6 @@ static void dvd_set_speed(char *device, unsigned speed) #endif #endif -const char * const dvd_audio_stream_types[8] = { "ac3","unknown","mpeg1","mpeg2ext","lpcm","unknown","dts" }; -const char * const dvd_audio_stream_channels[6] = { "mono", "stereo", "unknown", "unknown", "5.1/6.1", "5.1" }; - static struct stream_priv_s { int title; -- cgit v1.2.3 From 0d40667c8cf05c8957ad2e1bfec41ca41c88888a Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 10 Nov 2009 23:20:05 +0000 Subject: Move dvd_speed and dvd_set_speed to dvd_common and implement -dvd-speed support for dvdnav. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29890 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 73 ----------------------------------------------------- 1 file changed, 73 deletions(-) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index baa535500e..557cdaa4be 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -43,79 +43,6 @@ static char* dvd_device_current; int dvd_angle=1; -int dvd_speed=0; /* 0 => don't touch speed */ - -static void dvd_set_speed(char *device, unsigned speed) -{ -#if defined(__linux__) && defined(SG_IO) && defined(GPCMD_SET_STREAMING) - int fd; - unsigned char buffer[28]; - unsigned char cmd[12]; - struct sg_io_hdr sghdr; - struct stat st; - - memset(&st, 0, sizeof(st)); - - if (stat(device, &st) == -1) return; - - if (!S_ISBLK(st.st_mode)) return; /* not a block device */ - - switch (speed) { - case 0: /* don't touch speed setting */ - return; - case -1: /* restore default value */ - if (dvd_speed == 0) return; /* we haven't touched the speed setting */ - mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDrestoreSpeed); - break; - default: /* limit to KB/s */ - // speed < 100 is multiple of DVD single speed (1350KB/s) - if (speed < 100) - speed *= 1350; - mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitSpeed, speed); - break; - } - - memset(&sghdr, 0, sizeof(sghdr)); - sghdr.interface_id = 'S'; - sghdr.timeout = 5000; - sghdr.dxfer_direction = SG_DXFER_TO_DEV; - sghdr.dxfer_len = sizeof(buffer); - sghdr.dxferp = buffer; - sghdr.cmd_len = sizeof(cmd); - 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); - if (speed == -1) - buffer[0] = 4; /* restore default */ - else { - /* kilobyte */ - AV_WB32(buffer + 12, speed); - AV_WB32(buffer + 20, speed); - } - /* 1 second */ - AV_WB16(buffer + 18, 1000); - AV_WB16(buffer + 26, 1000); - - fd = open(device, O_RDWR | O_NONBLOCK); - if (fd == -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 - mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlimitOk); - - close(fd); -#endif -} #define LIBDVDREAD_VERSION(maj,min,micro) ((maj)*10000 + (min)*100 + (micro)) /* -- cgit v1.2.3 From 7694e9074d0242a0abe4d772cc54e334c80d049b Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 11 Nov 2009 09:28:21 +0000 Subject: Move headers related to setting dvd speed to dvd_common. This makes -dvd-speed work again. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29894 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 557cdaa4be..46e7100ec1 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -5,25 +5,12 @@ #include #include #include -#include #include #include "config.h" #include "mp_msg.h" #include "help_mp.h" -#ifdef __FreeBSD__ -#include -#endif - -#ifdef __linux__ -#include -#include -#include -#include -#include -#endif - #include #include @@ -39,7 +26,6 @@ #include "stream_dvd.h" #include "stream_dvd_common.h" #include "libmpdemux/demuxer.h" -#include "libavutil/intreadwrite.h" static char* dvd_device_current; int dvd_angle=1; -- cgit v1.2.3