Commit e8640eed authored by Sam Hocevar's avatar Sam Hocevar

 Changes to vlc:

  * Fixed arch-dependant build dependencies (Closes Debian bug #109722).
  * Minor changes to the (non-working) ncurses interface.

 Changes to libdvdcss (courtesy of H�kan Hjort <d95hjort@dtek.chalmers.se>):

  * If we see 3000 unencrypted blocks assume that the title is unencrypted.
  * If we have not seen any encrypted block and then discover that the block
    just read is not a valid block of an MPEG2 Program stream, assume that the
    title is unencrypted.
  * Empty keys (for unscrambled sectors) are now cached as well.
  * We try to decrypt the file even if DVD ioctls are not available.
parent a9c31c5a
......@@ -109,6 +109,7 @@ D: IDCT and YUV transformations
N: Hkan Hjort
E: d95hjort@dtek.chalmers.se
D: Solaris port of the DVD ioctls
D: libdvdcss enhancements
N: Samuel Hocevar
E: sam@zoy.org
......
......@@ -4,6 +4,7 @@
HEAD
* Minor changes to the (non-working) ncurses interface.
* Fixed a packet leak in DemuxPSI.
* Added gnome.h check and cleaned the error messages in the configure script.
* Tiny small optim in LPCM decoder.
......
......@@ -4,7 +4,12 @@
HEAD
* Nothing yet.
* If we see 3000 unencrypted blocks assume that the title is unencrypted.
* If we have not seen any encrypted block and then discover that the block
just read is not a valid block of an MPEG2 Program stream, assume that the
title is unencrypted.
* Empty keys (for unscrambled sectors) are now cached as well.
* We try to decrypt the file even if DVD ioctls are not available.
0.0.3
Wed, 22 Aug 2001 15:18:01 +0200
......
vlc (0.2.83-3) unstable; urgency=low
* Fixed syntax error in build dependencies (Closes: #109722).
-- Samuel Hocevar <sam@zoy.org> Sun, 9 Sep 2001 09:28:06 +0200
vlc (0.2.83-2) unstable; urgency=low
* Fixed build dependencies for architectures not supporting libasound2
......
......@@ -2,7 +2,7 @@ Source: vlc
Section: graphics
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), xlibs-dev, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev [alpha|i386|ia64|m68k|powerpc]
Build-Depends: debhelper (>=2.2.0), xlibs-dev, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev [alpha i386 ia64 m68k powerpc]
Standards-Version: 3.0.1
Package: vlc
......
......@@ -2,9 +2,10 @@
* css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: css.c,v 1.8 2001/08/06 13:27:59 sam Exp $
* $Id: css.c,v 1.9 2001/09/09 13:43:25 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
* Hkan Hjort <d95hjort@dtek.chalmers.se>
*
* based on:
* - css-auth by Derek Fawcus <derek@spider.com>
......@@ -295,6 +296,7 @@ int CSSGetKey( dvdcss_handle dvdcss, int i_pos, dvd_key_t p_titlekey )
* Does not use any player key table and ioctls.
*/
u8 p_buf[0x800];
u8 p_packstart[4] = { 0x00, 0x00, 0x01, 0xba };
dvd_key_t p_key;
boolean_t b_encrypted;
boolean_t b_stop_scanning;
......@@ -310,14 +312,30 @@ int CSSGetKey( dvdcss_handle dvdcss, int i_pos, dvd_key_t p_titlekey )
b_encrypted = 0;
b_stop_scanning = 0;
i_blocks_read = 0;
do
{
i_pos = dvdcss_seek( dvdcss, i_pos );
i_blocks_read = dvdcss_read( dvdcss, p_buf, 1, DVDCSS_NOFLAGS );
if( dvdcss_read( dvdcss, p_buf, 1, DVDCSS_NOFLAGS ) != 1 ) break;
/* PES_scrambling_control */
if( p_buf[0x14] & 0x30 )
/* Stop when we find a non MPEG stream block */
if( memcmp( p_buf, p_packstart, 4 ) )
{
/* The title is unencrypted */
if( !b_encrypted )
break;
/* dvdcss some times fail to find/crack the key,
hope that it's the same as the one in the next title
_dvdcss_debug( dvdcss, "no key found at end of title" );
*/
}
/* PES_scrambling_control on and make sure that the packet type
is one that can be scrambled */
if( p_buf[0x14] & 0x30 && ! ( p_buf[0x11] == 0xbb
|| p_buf[0x11] == 0xbe
|| p_buf[0x11] == 0xbf ) )
{
b_encrypted = 1;
i_best_plen = 0;
......@@ -347,9 +365,13 @@ int CSSGetKey( dvdcss_handle dvdcss, int i_pos, dvd_key_t p_titlekey )
}
}
i_pos += i_blocks_read;
i_pos += 1;
i_blocks_read += 1;
/* If we haven't seen any encrypted ones after 3000 blocks stop */
if( !b_encrypted && i_blocks_read >= 1000 ) break;
} while( i_blocks_read == 0x1 && !b_stop_scanning );
} while( !b_stop_scanning );
if( b_stop_scanning )
{
......
......@@ -2,10 +2,11 @@
* libdvdcss.c: DVD reading library.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.c,v 1.14 2001/08/06 13:28:00 sam Exp $
* $Id: libdvdcss.c,v 1.15 2001/09/09 13:43:25 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Hkan Hjort <d95hjort@dtek.chalmers.se>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -113,16 +114,19 @@ extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags )
i_ret = CSSTest( dvdcss );
if( i_ret < 0 )
{
_dvdcss_error( dvdcss, "css test failed" );
_dvdcss_close( dvdcss );
free( dvdcss );
return NULL;
_dvdcss_error( dvdcss, "CSS test failed" );
/* Disable the CSS ioctls and hope that it works? */
dvdcss->b_ioctls = 0;
dvdcss->b_encrypted = 1;
}
else
{
dvdcss->b_ioctls = 1;
dvdcss->b_encrypted = i_ret;
}
dvdcss->b_encrypted = i_ret;
/* If drive is encrypted, crack its key */
if( dvdcss->b_encrypted )
/* If disc is CSS protected and the ioctls work, authenticate the drive */
if( dvdcss->b_encrypted && dvdcss->b_ioctls )
{
i_ret = CSSInit( dvdcss );
......@@ -203,7 +207,8 @@ extern int dvdcss_title ( dvdcss_handle dvdcss, int i_block )
// p_key[0], p_key[1], p_key[2], p_key[3], p_key[4] );
/* Add key to keytable if it isn't empty */
if( p_key[0] | p_key[1] | p_key[2] | p_key[3] | p_key[4] )
/* We need to cache the fact that a title is unencrypted
if( p_key[0] | p_key[1] | p_key[2] | p_key[3] | p_key[4] ) */
{
dvd_title_t *p_newtitle;
......@@ -275,6 +280,24 @@ extern int dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
return 0;
}
/* For what we believe is an unencrypted title,
check that there are no encrypted blocks */
if( !( p_title->p_key[0] | p_title->p_key[1] | p_title->p_key[2] |
p_title->p_key[3] | p_title->p_key[4] ) )
{
for( i_index = i_ret; i_index; i_index-- )
{
if( ((u8*)p_buffer)[0x14] & 0x30 )
{
_dvdcss_error( dvdcss, "no key but found encrypted block" );
/* Only return the initial range of unscrambled blocks? */
i_ret = i_index;
/* or fail completely? return 0; */
}
(u8*)p_buffer += DVDCSS_BLOCK_SIZE;
}
}
/* Decrypt the blocks we managed to read */
for( i_index = i_ret; i_index; i_index-- )
{
......
......@@ -2,7 +2,7 @@
* private.h: private DVD reading library data
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.h,v 1.6 2001/07/25 08:41:21 gbazin Exp $
* $Id: libdvdcss.h,v 1.7 2001/09/09 13:43:25 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -38,6 +38,7 @@ struct dvdcss_s
/* Decryption stuff */
css_t css;
boolean_t b_ioctls;
boolean_t b_encrypted;
dvd_title_t *p_titles;
......
......@@ -2,7 +2,7 @@
* intf_ncurses.c: ncurses interface
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_ncurses.c,v 1.4 2001/07/25 03:12:33 sam Exp $
* $Id: intf_ncurses.c,v 1.5 2001/09/09 13:43:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -10,7 +10,7 @@
* 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -108,22 +108,22 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
{
intf_ErrMsg("error: %s", strerror(ENOMEM));
intf_ErrMsg( "intf error: %s", strerror(ENOMEM) );
return( 1 );
}
/* Initialize the curses library */
initscr();
/* Don't do NL -> CR/NL */
nonl();
/* Take input chars one at a time */
cbreak();
/* Don't echo */
noecho();
curs_set(0);
timeout(0);
return( 0 );
}
......@@ -144,11 +144,32 @@ static void intf_Close( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
{
signed char i_key;
while( !p_intf->b_die )
{
p_intf->pf_manage( p_intf );
msleep( INTF_IDLE_SLEEP );
mvaddstr( 1, 2, VOUT_TITLE " (ncurses interface)" );
mvaddstr( 3, 2, "keys:" );
mvaddstr( 4, 2, "Q,q.......quit" );
//mvaddstr( 5, 2, "No other keys are active yet." );
while( (i_key = getch()) != -1 )
{
switch( i_key )
{
case 'q':
case 'Q':
p_intf->b_die = 1;
break;
default:
break;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment