From da988249d76776d44c3220e188507c6335e9b5b5 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 11 May 2010 10:51:46 +0000 Subject: libdvdcss: cosmetics: Fix FSF address and program name in license headers. This merges upstream revisions 219 and 221. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31155 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libdvdcss/libdvdcss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdvdcss/libdvdcss.c') diff --git a/libdvdcss/libdvdcss.c b/libdvdcss/libdvdcss.c index 1be814f838..75b11642ed 100644 --- a/libdvdcss/libdvdcss.c +++ b/libdvdcss/libdvdcss.c @@ -7,19 +7,19 @@ * Copyright (C) 1998-2008 VideoLAN * $Id$ * - * This program is free software; you can redistribute it and/or modify + * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * You should have received a copy of the GNU General Public License along + * with this library; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** -- cgit v1.2.3 From ec814ff6378e08dd426c0413f14345c449d30bcb Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 11 May 2010 10:58:50 +0000 Subject: libdvdcss: OS/2 support; this merges upstream revisions 220 and 229. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31156 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libdvdcss/libdvdcss.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'libdvdcss/libdvdcss.c') diff --git a/libdvdcss/libdvdcss.c b/libdvdcss/libdvdcss.c index 75b11642ed..d189faddf2 100644 --- a/libdvdcss/libdvdcss.c +++ b/libdvdcss/libdvdcss.c @@ -166,7 +166,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) char *psz_method = getenv( "DVDCSS_METHOD" ); char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); char *psz_cache = getenv( "DVDCSS_CACHE" ); -#ifndef WIN32 +#if !defined(WIN32) && !defined(SYS_OS2) char *psz_raw_device = getenv( "DVDCSS_RAW_DEVICE" ); #endif @@ -184,7 +184,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) /* * Initialize structure with default values */ -#ifndef WIN32 +#if !defined(WIN32) && !defined(SYS_OS2) dvdcss->i_raw_fd = -1; #endif dvdcss->p_titles = NULL; @@ -306,7 +306,25 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) /* Cache our keys in ${HOME}/.dvdcss/ */ if( psz_home ) { - snprintf( psz_buffer, PATH_MAX, "%s/.dvdcss", psz_home ); + int home_pos = 0; + +#ifdef SYS_OS2 + if( *psz_home == '/' || *psz_home == '\\') + { + char *psz_unixroot = getenv("UNIXROOT"); + + if( psz_unixroot && + psz_unixroot[0] && + psz_unixroot[1] == ':' && + psz_unixroot[2] == '\0') + { + strcpy( psz_buffer, psz_unixroot ); + home_pos = 2; + } + } +#endif + snprintf( psz_buffer + home_pos, PATH_MAX - home_pos, + "%s/.dvdcss", psz_home ); psz_buffer[PATH_MAX-1] = '\0'; psz_cache = psz_buffer; } @@ -536,7 +554,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) } nocache: -#ifndef WIN32 +#if !defined(WIN32) && !defined(SYS_OS2) if( psz_raw_device != NULL ) { _dvdcss_raw_open( dvdcss, psz_raw_device ); -- cgit v1.2.3 From 6f3e65b6f53547a0f19f89728c7113f6de724b35 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 11 May 2010 11:10:28 +0000 Subject: libdvdcss: Fix potential format string crash; check RPC status on disc access. This merges upstream revisions 223 and 224 + 225. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31157 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libdvdcss/libdvdcss.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libdvdcss/libdvdcss.c') diff --git a/libdvdcss/libdvdcss.c b/libdvdcss/libdvdcss.c index d189faddf2..f39d7025d4 100644 --- a/libdvdcss/libdvdcss.c +++ b/libdvdcss/libdvdcss.c @@ -367,7 +367,14 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) if( dvdcss->b_ioctls ) { i_ret = _dvdcss_test( dvdcss ); - if( i_ret < 0 ) + if( i_ret == -2 ) + { + /* Scrambled disk, RPC-II drive, no region set: bail out */ + free( dvdcss->psz_device ); + free( dvdcss ); + return NULL; + } + else if( i_ret < 0 ) { /* Disable the CSS ioctls and hope that it works? */ print_debug( dvdcss, @@ -420,7 +427,6 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) if( psz_cache ) { uint8_t p_sector[DVDCSS_BLOCK_SIZE]; - char psz_debug[PATH_MAX + 30]; char psz_key[1 + KEY_SIZE * 2 + 1]; char *psz_title; uint8_t *psz_serial; @@ -548,9 +554,8 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target ) /* Pointer to the filename we will use. */ dvdcss->psz_block = dvdcss->psz_cachefile + i; - sprintf( psz_debug, "using CSS key cache dir: %s", - dvdcss->psz_cachefile ); - print_debug( dvdcss, psz_debug ); + print_debug( dvdcss, "using CSS key cache dir: %s", + dvdcss->psz_cachefile ); } nocache: -- cgit v1.2.3