/*****************************************************************************
* bd.c: BluRay Disc support (uncrypted)
*****************************************************************************
- * Copyright (C) 2009 the VideoLAN team
+ * Copyright (C) 2009 VLC authors and VideoLAN
* $Id$
*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
*
- * 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
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
# include "config.h"
#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
#include <limits.h>
+#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
- "Caching value for BDs. This "\
- "value should be set in milliseconds." )
-
static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
vlc_module_begin ()
set_shortname( N_("BD") )
- set_description( N_("Blu-Ray Disc Input") )
+ set_description( N_("BluRay Disc Input") )
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_ACCESS )
- add_integer( "bd-caching", DEFAULT_PTS_DELAY / 1000, NULL,
- CACHING_TEXT, CACHING_LONGTEXT, true )
set_capability( "access_demux", 60 )
- add_shortcut( "bd" )
- add_shortcut( "file" )
+ add_shortcut( "bd", "file" )
set_callbacks( Open, Close )
vlc_module_end ()
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
+ if( p_demux->psz_file == NULL )
+ return VLC_EGENERIC;
if( *p_demux->psz_access &&
strcmp( p_demux->psz_access, "bd" ) &&
strcmp( p_demux->psz_access, "file" ) )
/* */
bool b_shortname;
- char *psz_base = FindPathBase( p_demux->psz_path, &b_shortname );
+ char *psz_base = FindPathBase( p_demux->psz_file, &b_shortname );
if( !psz_base )
return VLC_EGENERIC;
case DEMUX_GET_PTS_DELAY:
{
int64_t *pi_delay = (int64_t*)va_arg( args, int64_t * );
- *pi_delay = var_GetInteger( p_demux, "bd-caching" ) * INT64_C(1000);
+
+ *pi_delay =
+ INT64_C(1000) * var_InheritInteger( p_demux, "disc-caching" );
return VLC_SUCCESS;
}
/* XXX
* we ensure that the TS packet start at the begining of the buffer,
* it ensure proper TS parsing */
- block_t *p_block = block_New( p_demux, i_packets * BD_TS_PACKET_SIZE + BD_TS_PACKET_HEADER );
+ block_t *p_block = block_Alloc( i_packets * BD_TS_PACKET_SIZE + BD_TS_PACKET_HEADER );
if( !p_block )
return -1;
if( asprintf( &psz_tmp, "%s/%s", psz_base, ppsz_name[i] ) < 0 )
return VLC_EGENERIC;
- bool b_ok = utf8_stat( psz_tmp, &s ) == 0 && S_ISREG( s.st_mode );
+ bool b_ok = vlc_stat( psz_tmp, &s ) == 0 && S_ISREG( s.st_mode );
free( psz_tmp );
if( !b_ok )
psz_base[strlen(psz_base)-1] = '\0';
/* */
- if( utf8_stat( psz_base, &s ) || !S_ISDIR( s.st_mode ) )
+ if( vlc_stat( psz_base, &s ) || !S_ISDIR( s.st_mode ) )
goto error;
/* Check BDMV */
if( asprintf( &psz_tmp, "%s/BDMV", psz_base ) < 0 )
goto error;
- if( !utf8_stat( psz_tmp, &s ) && S_ISDIR( s.st_mode ) )
+ if( !vlc_stat( psz_tmp, &s ) && S_ISDIR( s.st_mode ) )
{
free( psz_base );
psz_base = psz_tmp;
char **ppsz_list;
- int i_list = utf8_scandir( psz_playlist, &ppsz_list, pf_filter, ScanSort );
+ int i_list = vlc_scandir( psz_playlist, &ppsz_list, pf_filter, ScanSort );
for( int i = 0; i < i_list; i++ )
{
break;
}
if( fmt.i_priority < 0 )
- msg_Dbg( p_demux, "Hidding one stream (pid=%d)", fmt.i_id );
+ msg_Dbg( p_demux, "Hiding one stream (pid=%d)", fmt.i_id );
/* */
es_out_id_t *p_es = es_out_Add( p_demux->out, &fmt );