* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_udf.c,v 1.12 2001/07/27 01:05:17 sam Exp $
+ * $Id: dvd_udf.c,v 1.19 2002/03/06 01:20:56 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME dvd
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include "defs.h"
-
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
+#include <videolan/vlc.h>
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#elif defined( _MSC_VER ) && defined( _WIN32 )
# include <strings.h>
#endif
-#include <videolan/dvdcss.h>
-
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-
-#include "intf_msg.h"
+#ifdef GOD_DAMN_DMCA
+# include "dummy_dvdcss.h"
+#else
+# include <videolan/dvdcss.h>
+#endif
-#include "input_dvd.h"
+#include "dvd.h"
#include "dvd_ifo.h"
-#include "modules.h"
-#include "modules_export.h"
-
#define UDFADshort 1
#define UDFADlong 2
#define UDFADext 4
static int UDFReadLB( dvdcss_handle dvdhandle, off_t i_lba,
size_t i_block_count, u8 *pi_data )
{
- if( dvdcss_seek( dvdhandle, i_lba ) < 0 )
+ if( dvdcss_seek( dvdhandle, i_lba, DVDCSS_NOFLAGS ) < 0 )
{
- intf_ErrMsg( "UDF: Postion not found" );
+ intf_ErrMsg( "dvd error: block %i not found", i_lba );
return 0;
}
if( i_lb_size != DVD_LB_SIZE )
{
- intf_ErrMsg( "UDF: Non valid sector size (%d)", i_lb_size );
+ intf_ErrMsg( "dvd error: invalid UDF sector size (%d)", i_lb_size );
return 1;
}
/*****************************************************************************
- * UDFFindFile: looks for a file on the UDF disc/imagefile
+ * DVDUDFFindFile: looks for a file on the UDF disc/imagefile
*****************************************************************************
* Path has to be the absolute pathname on the UDF filesystem,
* starting with '/'.
* returns absolute LB number, or 0 on error
*****************************************************************************/
-u32 UDFFindFile( dvdcss_handle dvdhandle, char * psz_path )
+u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path )
{
struct partition_s partition;
struct ad_s root_icb;
i_partition = 0;
if( !UDFFindPartition( i_partition, &partition ) )
{
- intf_ErrMsg( "UDF: Partition 0 not found" );
+ intf_ErrMsg( "dvd error: partition 0 not found" );
return 0;
}
if( i_tag_id != 256 )
{
- intf_ErrMsg( "UDF: Bad descriptor" );
+ intf_ErrMsg( "dvd error: bad UDF descriptor" );
return 0;
}
if( root_icb.i_partition != i_partition )
{
- intf_ErrMsg( "UDF: Bad partition" );
+ intf_ErrMsg( "dvd error: bad UDF partition" );
return 0;
}
/* Find root dir */
if( !UDFMapICB( root_icb, &i_file_type, &file, partition ) )
{
- intf_ErrMsg( "UDF: Can't find root dir" );
+ intf_ErrMsg( "dvd error: can't find root dir" );
return 0;
}
/* root dir should be dir */
if( i_file_type != 4 )
{
- intf_ErrMsg( "UDF: Root dir error" );
+ intf_ErrMsg( "dvd error: root dir error" );
return 0;
}
{
if( !UDFScanDir( file, psz_token, &icb, partition ) )
{
- intf_ErrMsg( "UDF: Scan dir error" );
+ intf_ErrMsg( "dvd error: scan dir error" );
return 0;
}
if( !UDFMapICB ( icb, &i_file_type, &file, partition ) )
{
- intf_ErrMsg( "UDF: ICB error" );
+ intf_ErrMsg( "dvd error: ICB error" );
return 0;
}