Commit 1eb6c844 authored by Stéphane Borel's avatar Stéphane Borel

*** empty log message ***

parent ddc7a493
......@@ -339,9 +339,6 @@
/* Variable containing network interface */
#define INPUT_IFACE_VAR "iface"
#define INPUT_TITLE_VAR "input_title"
#define INPUT_CHAPTER_VAR "input_chapter"
#define INPUT_ANGLE_VAR "input_angle"
#define INPUT_AUDIO_VAR "input_audio"
#define INPUT_CHANNEL_VAR "input_channel"
#define INPUT_SUBTITLE_VAR "input_subtitle"
......
......@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.17 2002/02/25 18:42:09 stef Exp $
* $Id: ac3_spdif.c,v 1.18 2002/03/04 01:53:56 stef Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -69,6 +69,7 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_CATEGORY_HINT( "Misc Options", NULL )
ADD_BOOL( AOUT_SPDIF_VAR, NULL, "enable AC3 pass-through mode", NULL )
MODULE_CONFIG_STOP
......
......@@ -2,7 +2,7 @@
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: dvd.c,v 1.22 2002/03/01 01:12:28 stef Exp $
* $Id: dvd.c,v 1.23 2002/03/04 01:53:56 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -53,6 +53,7 @@ static void UnprobeLibDVDCSS( void );
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_CATEGORY_HINT( "[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]", NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
......
......@@ -8,7 +8,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.126 2002/03/03 17:34:27 xav Exp $
* $Id: input_dvd.c,v 1.127 2002/03/04 01:53:56 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -52,8 +52,6 @@
#if defined( WIN32 )
# include <io.h> /* read() */
#else
# include <sys/uio.h> /* struct iovec */
#endif
#ifdef GOD_DAMN_DMCA
......@@ -62,10 +60,6 @@
# include <videolan/dvdcss.h>
#endif
#if defined( WIN32 )
# include "input_iovec.h"
#endif
#include "stream_control.h"
#include "input_ext-intf.h"
#include "input_ext-dec.h"
......@@ -243,6 +237,19 @@ static int DVDRewind( input_thread_t * p_input )
* Data access functions
*/
#define PARSE( chr, action ) \
psz_parser = p_input->psz_name; \
while( *(psz_parser) && *(psz_parser) != (chr) ) \
{ \
(psz_parser)++; \
} \
\
if( *(psz_parser) == (chr) ) \
{ \
*(psz_parser) = '\0'; \
(action); \
}
/*****************************************************************************
* DVDOpen: open dvd
*****************************************************************************/
......@@ -251,14 +258,20 @@ static int DVDOpen( struct input_thread_s *p_input )
struct stat stat_info;
char * psz_parser = p_input->psz_name;
char * psz_device = p_input->psz_name;
char * psz_raw;
char * psz_next;
dvdcss_handle dvdhandle;
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
int i_title;
int i_chapter;
boolean_t b_need_free = 0;
boolean_t b_options = 0;
int i_title = 1;
int i_chapter = 1;
int i_angle = 1;
int i;
/* Parse input string : device[@rawdevice] */
/* Parse input string :
* [device][@rawdevice][@[title][,[chapter][,angle]]] */
while( *psz_parser && *psz_parser != '@' )
{
psz_parser++;
......@@ -268,9 +281,75 @@ static int DVDOpen( struct input_thread_s *p_input )
{
/* Found raw device */
*psz_parser = '\0';
psz_parser++;
psz_raw = ++psz_parser;
}
else
{
psz_raw = NULL;
}
config_PutPszVariable( "DVDCSS_RAW_DEVICE", psz_parser );
if( !strtol( psz_parser, NULL, 10 ) )
{
while( *psz_parser && *psz_parser != '@' )
{
psz_parser++;
}
if( *psz_parser == '@' )
{
*psz_parser = '\0';
++psz_parser;
b_options = 1;
}
else
{
psz_parser = psz_raw + 1;
for( i=0 ; i<3 ; i++ )
{
if( !*psz_parser )
{
break;
}
if( strtol( psz_parser, NULL, 10 ) )
{
psz_parser = psz_raw;
psz_raw = NULL;
b_options = 1;
break;
}
psz_parser++;
}
}
}
else
{
psz_raw = NULL;
b_options = 1;
}
if( b_options )
{
/* Found options */
i_title = (int)strtol( psz_parser, &psz_next, 10 );
if( *psz_next )
{
psz_parser = psz_next + 1;
i_chapter = (int)strtol( psz_parser, &psz_next, 10 );
if( *psz_next )
{
i_angle = (int)strtol( psz_next + 1, NULL, 10 );
}
}
i_title = i_title ? i_title : 1;
i_chapter = i_chapter ? i_chapter : 1;
i_angle = i_angle ? i_angle : 1;
}
if( !*psz_device )
{
psz_device = config_GetPszVariable( INPUT_DVD_DEVICE_VAR );
b_need_free = 1;
}
if( stat( psz_device, &stat_info ) == -1 )
......@@ -283,13 +362,26 @@ static int DVDOpen( struct input_thread_s *p_input )
#ifndef WIN32
if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) )
{
intf_WarnMsg( 3, "input : DVD plugin discarded"
intf_WarnMsg( 3, "input: DVD plugin discarded"
" (not a valid block device)" );
return -1;
}
#endif
if( psz_raw )
{
if( *psz_raw )
{
setenv( "DVDCSS_RAW_DEVICE", psz_raw, 1 );
}
else
{
psz_raw = NULL;
}
}
intf_WarnMsg( 2, "input: dvd=%s raw=%s", psz_device, psz_parser );
intf_WarnMsg( 2, "input: dvd=%s raw=%s title=%d chapter=%d angle=%d",
psz_device, psz_raw, i_title, i_chapter, i_angle );
/*
* set up input
......@@ -314,6 +406,11 @@ static int DVDOpen( struct input_thread_s *p_input )
* get plugin ready
*/
dvdhandle = dvdcss_open( psz_device );
if( b_need_free )
{
free( psz_device );
}
if( dvdhandle == NULL )
{
......@@ -331,6 +428,10 @@ static int DVDOpen( struct input_thread_s *p_input )
p_dvd->dvdhandle = (dvdcss_handle) dvdhandle;
p_input->p_access_data = (void *)p_dvd;
p_dvd->i_title = i_title;
p_dvd->i_chapter = i_chapter;
p_dvd->i_angle = i_angle;
if( dvdcss_seek( p_dvd->dvdhandle, 0, DVDCSS_NOFLAGS ) < 0 )
{
intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
......@@ -391,23 +492,8 @@ static int DVDOpen( struct input_thread_s *p_input )
title_inf.p_attr[i-1].i_start_sector;
}
#undef area
/* Get requested title - if none try the first title */
i_title = config_GetIntVariable( INPUT_TITLE_VAR );
if( i_title <= 0 || i_title > title_inf.i_title_nb )
{
i_title = 1;
}
#undef title_inf
/* Get requested chapter - if none defaults to first one */
i_chapter = config_GetIntVariable( INPUT_CHAPTER_VAR );
if( i_chapter <= 0 )
{
i_chapter = 1;
}
p_area = p_input->stream.pp_areas[i_title];
p_area->i_part = i_chapter;
......@@ -516,7 +602,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
* Angle management
*/
p_dvd->i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb;
p_dvd->i_angle = config_GetIntVariable( INPUT_ANGLE_VAR );
if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
{
p_dvd->i_angle = 1;
......
......@@ -2,7 +2,7 @@
* dvdread.c : DvdRead input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: dvdread.c,v 1.11 2002/03/01 01:12:28 stef Exp $
* $Id: dvdread.c,v 1.12 2002/03/04 01:53:56 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -39,6 +39,7 @@ void _M( demux_getfunctions)( function_list_t * p_function_list );
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_CATEGORY_HINT( "[dvdread:][device][@[title][,[chapter][,angle]]]", NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input_dvdread.c,v 1.24 2002/03/02 03:29:13 stef Exp $
* $Id: input_dvdread.c,v 1.25 2002/03/04 01:53:56 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -236,18 +236,56 @@ static int DvdReadRewind( input_thread_t * p_input )
*****************************************************************************/
static int DvdReadOpen( struct input_thread_s *p_input )
{
char * psz_parser = p_input->psz_name;
char * psz_source = p_input->psz_name;
char * psz_next;
struct stat stat_info;
thread_dvd_data_t * p_dvd;
dvd_reader_t * p_dvdread;
input_area_t * p_area;
int i_title;
int i_chapter;
boolean_t b_need_free = 0;
int i_title = 1;
int i_chapter = 1;
int i_angle = 1;
int i;
if( stat( p_input->psz_name, &stat_info ) == -1 )
while( *psz_parser && *psz_parser != '@' )
{
intf_ErrMsg( "input error: cannot stat() device `%s' (%s)",
p_input->psz_name, strerror(errno));
psz_parser++;
}
if( *psz_parser == '@' )
{
/* Found options */
*psz_parser = '\0';
++psz_parser;
i_title = (int)strtol( psz_parser, &psz_next, 10 );
if( *psz_next )
{
psz_parser = psz_next + 1;
i_chapter = (int)strtol( psz_parser, &psz_next, 10 );
if( *psz_next )
{
i_angle = (int)strtol( psz_next + 1, NULL, 10 );
}
}
i_title = i_title ? i_title : 1;
i_chapter = i_chapter ? i_chapter : 1;
i_angle = i_angle ? i_angle : 1;
}
if( !*psz_source )
{
psz_source = config_GetPszVariable( INPUT_DVD_DEVICE_VAR );
b_need_free = 1;
}
if( stat( psz_source, &stat_info ) == -1 )
{
intf_ErrMsg( "input error: cannot stat() source `%s' (%s)",
psz_source, strerror(errno));
return( -1 );
}
if( !S_ISBLK(stat_info.st_mode) &&
......@@ -259,7 +297,17 @@ static int DvdReadOpen( struct input_thread_s *p_input )
return -1;
}
p_dvdread = DVDOpen( p_input->psz_name );
intf_WarnMsg( 2, "input: dvdroot=%s title=%d chapter=%d angle=%d",
psz_source, i_title, i_chapter, i_angle );
p_dvdread = DVDOpen( psz_source );
if( b_need_free )
{
free( psz_source );
}
if( ! p_dvdread )
{
intf_ErrMsg( "dvdread error: libdvdcss can't open source" );
......@@ -280,6 +328,10 @@ static int DvdReadOpen( struct input_thread_s *p_input )
p_dvd->p_title = NULL;
p_dvd->p_vts_file = NULL;
p_dvd->i_title = i_title;
p_dvd->i_chapter = i_chapter;
p_dvd->i_angle = i_angle;
p_input->p_access_data = (void *)p_dvd;
/* Ifo allocation & initialisation */
......@@ -339,23 +391,8 @@ static int DvdReadOpen( struct input_thread_s *p_input )
area[i]->i_plugin_data = tt_srpt->title[i-1].title_set_nr;
}
#undef area
/* Get requested title - if none try the first title */
i_title = config_GetIntVariable( INPUT_TITLE_VAR );
if( i_title <= 0 || i_title > tt_srpt->nr_of_srpts )
{
i_title = 1;
}
#undef tt_srpt
/* Get requested chapter - if none defaults to first one */
i_chapter = config_GetIntVariable( INPUT_CHAPTER_VAR );
if( i_chapter <= 0 )
{
i_chapter = 1;
}
p_input->stream.pp_areas[i_title]->i_part = i_chapter;
p_area = p_input->stream.pp_areas[i_title];
......@@ -515,15 +552,15 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
/*
* Angle management
*/
p_area->i_angle_nb = p_vmg->tt_srpt->title[p_area->i_id-1].nr_of_angles;
p_area->i_angle = config_GetIntVariable( INPUT_ANGLE_VAR );
p_dvd->i_angle_nb = p_vmg->tt_srpt->title[p_area->i_id-1].nr_of_angles;
if( ( p_area->i_angle <= 0 ) || p_area->i_angle > p_area->i_angle_nb )
if( p_dvd->i_angle > p_area->i_angle_nb )
{
p_area->i_angle = 1;
p_dvd->i_angle = 1;
}
p_dvd->i_angle = p_area->i_angle;
p_dvd->i_angle_nb = p_area->i_angle_nb;
p_area->i_angle = p_dvd->i_angle;
p_area->i_angle_nb = p_dvd->i_angle_nb;
/*
* We've got enough info, time to open the title set data.
......
......@@ -2,7 +2,7 @@
* input_dvdread.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dvdread.h,v 1.5 2002/03/01 01:12:28 stef Exp $
* $Id: input_dvdread.h,v 1.6 2002/03/04 01:53:56 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -48,6 +48,11 @@ typedef struct thread_dvd_data_s
ifo_handle_t * p_vmg_file;
ifo_handle_t * p_vts_file;
int i_title;
int i_chapter;
int i_angle;
int i_angle_nb;
tt_srpt_t * p_tt_srpt;
pgc_t * p_cur_pgc;
......@@ -62,9 +67,6 @@ typedef struct thread_dvd_data_s
int i_cur_cell;
int i_next_cell;
int i_chapter;
boolean_t b_eoc;
int i_angle_nb;
int i_angle;
} thread_dvd_data_t;
......@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.16 2002/02/24 20:51:10 gbazin Exp $
* $Id: gtk_open.c,v 1.17 2002/03/04 01:53:56 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -181,19 +181,12 @@ void GtkDiscOpenOk( GtkButton * button, gpointer user_data )
GtkCList * p_playlist_clist;
char * psz_device, *psz_source, *psz_method;
int i_end = p_main->p_playlist->i_size;
int i_title, i_chapter;
gtk_widget_hide( p_intf->p_sys->p_disc );
psz_device = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) );
/* "dvd:foo" has size 5 + strlen(foo) */
psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+ strlen( psz_device ) + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
}
/* Check which method was activated */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_dvd" ) )->active )
......@@ -213,16 +206,26 @@ void GtkDiscOpenOk( GtkButton * button, gpointer user_data )
}
/* Select title and chapter */
config_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
i_title = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) ) );
GTK_WIDGET(button), "disc_title" ) ) );
config_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
i_chapter = gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_chapter" ) ) ) );
GTK_WIDGET(button), "disc_chapter" ) ) );
/* "dvd:foo" has size 5 + strlen(foo) */
psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+ strlen( psz_device ) + 2 /* @, */
+ 4 /* i_title & i_chapter < 100 */ + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
}
/* Build source name and add it to playlist */
sprintf( psz_source, "%s:%s", psz_method, psz_device );
sprintf( psz_source, "%s:%s@%d,%d",
psz_method, psz_device, i_title, i_chapter );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: main.c,v 1.157 2002/02/27 03:47:56 sam Exp $
* $Id: main.c,v 1.158 2002/03/04 01:53:56 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -163,9 +163,6 @@ ADD_STRING ( INPUT_CHANNEL_SERVER_VAR, "localhost", NULL,
ADD_INTEGER ( INPUT_CHANNEL_PORT_VAR, 6010, NULL, "channel server port", NULL )
ADD_STRING ( INPUT_IFACE_VAR, "eth0", NULL, "network interface", NULL )
ADD_INTEGER ( INPUT_TITLE_VAR, -1, NULL, "choose title", NULL )
ADD_INTEGER ( INPUT_CHAPTER_VAR, -1, NULL, "choose chapter", NULL )
ADD_INTEGER ( INPUT_ANGLE_VAR, -1, NULL, "chosse angle", NULL )
ADD_INTEGER ( INPUT_AUDIO_VAR, -1, NULL, "choose audio", NULL )
ADD_INTEGER ( INPUT_CHANNEL_VAR, -1, NULL, "choose channel", NULL )
ADD_INTEGER ( INPUT_SUBTITLE_VAR, -1, NULL, "choose subtitles", NULL )
......
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