Commit 26300bb9 authored by Stéphane Borel's avatar Stéphane Borel

-better handling of angles: you should be able to change on the fly now

-removed � bug added at my last commit in css code; cleaned CSSGetKey

-various changes and bugfixes in the gnome interface.
parent 224c0e0b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling * dvd_css.c: Functions for DVD authentification and unscrambling
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.25 2001/04/20 05:40:03 stef Exp $ * $Id: dvd_css.c,v 1.26 2001/04/22 00:08:25 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -264,6 +264,12 @@ int CSSInit( int i_fd, css_t * p_css ) ...@@ -264,6 +264,12 @@ int CSSInit( int i_fd, css_t * p_css )
} }
memcpy( p_css->disc.pi_key_check, p_buffer, 2048 ); memcpy( p_css->disc.pi_key_check, p_buffer, 2048 );
/* initialize title key to know it empty */
for( i = 0 ; i < KEY_SIZE ; i++ )
{
p_css->pi_title_key[i] = 0;
}
/* Test authentication success */ /* Test authentication success */
switch( CSSGetASF( i_fd ) ) switch( CSSGetASF( i_fd ) )
{ {
...@@ -302,33 +308,25 @@ int CSSGetKey( int i_fd, css_t * p_css ) ...@@ -302,33 +308,25 @@ int CSSGetKey( int i_fd, css_t * p_css )
*/ */
u8 pi_buf[0x800]; u8 pi_buf[0x800];
dvd_key_t pi_key; dvd_key_t pi_key;
title_key_t p_title_key[10];
off_t i_pos; off_t i_pos;
boolean_t b_encrypted; boolean_t b_encrypted;
boolean_t b_stop_scanning; boolean_t b_stop_scanning;
int i_title;
int i_bytes_read; int i_bytes_read;
int i_best_plen; int i_best_plen;
int i_best_p; int i_best_p;
int i_registered_keys; int i,j;
int i_total_keys_found;
int i_highest; for( i = 0 ; i < KEY_SIZE ; i++ )
int i,j,k; {
pi_key[i] = 0;
}
memset( p_title_key, 0, 10 );
memset( &pi_key, 0, 10 );
b_encrypted = 0; b_encrypted = 0;
b_stop_scanning = 0; b_stop_scanning = 0;
i_registered_keys = 0 ;
i_total_keys_found = 0 ;
i_highest = 0;
/* Position of the title on the disc */ /* Position of the title on the disc */
i_title = p_css->i_title;
i_pos = p_css->i_title_pos; i_pos = p_css->i_title_pos;
//fprintf( stderr, "CSS %d start pos: %lld\n", i_title, i_pos );
do { do {
i_pos = lseek( i_fd, i_pos, SEEK_SET ); i_pos = lseek( i_fd, i_pos, SEEK_SET );
i_bytes_read = read( i_fd, pi_buf, 0x800 ); i_bytes_read = read( i_fd, pi_buf, 0x800 );
...@@ -359,39 +357,7 @@ int CSSGetKey( int i_fd, css_t * p_css ) ...@@ -359,39 +357,7 @@ int CSSGetKey( int i_fd, css_t * p_css )
&pi_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p], &pi_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p],
(dvd_key_t*)&pi_buf[0x54], (dvd_key_t*)&pi_buf[0x54],
&pi_key ); &pi_key );
while( i>=0 ) b_stop_scanning = ( i >= 0 );
{
k = 0;
for( j=0 ; j<i_registered_keys ; j++ )
{
if( memcmp( &(p_title_key[j].pi_key),
&pi_key, sizeof(dvd_key_t) ) == 0 )
{
p_title_key[j].i_occ++;
i_total_keys_found++;
k = 1;
}
}
if( k == 0 )
{
memcpy( &(p_title_key[i_registered_keys].pi_key),
&pi_key, sizeof(dvd_key_t) );
p_title_key[i_registered_keys++].i_occ = 1;
i_total_keys_found++;
}
i = CSSCracker( i, &pi_buf[0x80],
&pi_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p],
(dvd_key_t*)&pi_buf[0x54], &pi_key);
}
/* Stop search if we find one occurence of the key
* I have never found a DVD for which it is not enough
* but we should take care of that */
if( i_registered_keys == 1 && p_title_key[0].i_occ >= 1 )
{
b_stop_scanning = 1;
}
} }
} }
...@@ -400,8 +366,10 @@ int CSSGetKey( int i_fd, css_t * p_css ) ...@@ -400,8 +366,10 @@ int CSSGetKey( int i_fd, css_t * p_css )
if( b_stop_scanning) if( b_stop_scanning)
{ {
intf_WarnMsg( 1, memcpy( p_css->pi_title_key,
"css info: found enough occurencies of the same key." ); &pi_key, sizeof(dvd_key_t) );
intf_WarnMsg( 2, "css info: vts key initialized" );
return 0;
} }
if( !b_encrypted ) if( !b_encrypted )
...@@ -410,68 +378,7 @@ int CSSGetKey( int i_fd, css_t * p_css ) ...@@ -410,68 +378,7 @@ int CSSGetKey( int i_fd, css_t * p_css )
return 0; return 0;
} }
if( b_encrypted && i_registered_keys == 0 )
{
intf_ErrMsg( "css error: unable to determine keys from file" );
return -1; return -1;
}
for( i = 0 ; i < i_registered_keys - 1 ; i++ )
{
for( j = i + 1 ; j < i_registered_keys ; j++ )
{
if( p_title_key[j].i_occ > p_title_key[i].i_occ )
{
memcpy( &pi_key, &(p_title_key[j].pi_key), sizeof(dvd_key_t) );
k = p_title_key[j].i_occ;
memcpy( &(p_title_key[j].pi_key),
&(p_title_key[i].pi_key), sizeof(dvd_key_t) );
p_title_key[j].i_occ = p_title_key[i].i_occ;
memcpy( &(p_title_key[i].pi_key),&pi_key, sizeof(dvd_key_t) );
p_title_key[i].i_occ = k;
}
}
}
#ifdef STATS
intf_WarnMsg( 1, "css info: key(s) & key probability" );
intf_WarnMsg( 1, "----------------------------------" );
#endif
for( i=0 ; i<i_registered_keys ; i++ )
{
#ifdef STATS
intf_WarnMsg( 1, "%d) %02X %02X %02X %02X %02X - %3.2f%%", i,
p_title_key[i].pi_key[0], p_title_key[i].pi_key[1],
p_title_key[i].pi_key[2], p_title_key[i].pi_key[3],
p_title_key[i].pi_key[4],
p_title_key[i].i_occ * 100.0 / i_total_keys_found );
#endif
if( p_title_key[i_highest].i_occ * 100.0 / i_total_keys_found
<= p_title_key[i].i_occ*100.0 / i_total_keys_found )
{
i_highest = i;
}
}
/* The "find the key with the highest probability" code
* is untested, as I haven't been able to find a VOB that
* produces multiple keys (RT)
*/
intf_WarnMsg( 3, "css info: title %d, key %02X %02X %02X %02X %02X",
i_title, p_title_key[i_highest].pi_key[0],
p_title_key[i_highest].pi_key[1],
p_title_key[i_highest].pi_key[2],
p_title_key[i_highest].pi_key[3],
p_title_key[i_highest].pi_key[4] );
memcpy( p_css->pi_title_key,
p_title_key[i_highest].pi_key, KEY_SIZE );
intf_WarnMsg( 2, "css info: vts key initialized" );
return 0;
#else /* HAVE_CSS */ #else /* HAVE_CSS */
intf_ErrMsg( "css error: css decryption unavailable" ); intf_ErrMsg( "css error: css decryption unavailable" );
...@@ -520,9 +427,6 @@ int CSSDescrambleSector( dvd_key_t pi_key, u8* pi_sec ) ...@@ -520,9 +427,6 @@ int CSSDescrambleSector( dvd_key_t pi_key, u8* pi_sec )
pi_sec++; pi_sec++;
i_t5 >>= 8; i_t5 >>= 8;
} }
pi_sec[0x14] &= 0x8F;
} }
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing * dvd_ifo.c: Functions for ifo parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.23 2001/04/20 05:40:03 stef Exp $ * $Id: dvd_ifo.c,v 1.24 2001/04/22 00:08:25 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -663,9 +663,9 @@ DumpBits( p_ifo, pi_buffer, &p_current, 2 ); ...@@ -663,9 +663,9 @@ DumpBits( p_ifo, pi_buffer, &p_current, 2 );
p_current = FillBuffer( p_ifo, pi_buffer, i_start + p_current = FillBuffer( p_ifo, pi_buffer, i_start +
title_inf.pi_start_byte[i] ); title_inf.pi_start_byte[i] );
title_inf.p_title_start[i].i_program_chain_num = title_inf.p_title_start[i].i_title_id =
ReadWord( p_ifo, pi_buffer, &p_current ); ReadWord( p_ifo, pi_buffer, &p_current );
title_inf.p_title_start[i].i_program_num = ReadWord( p_ifo, pi_buffer, &p_current ); title_inf.p_title_start[i].i_chapter = ReadWord( p_ifo, pi_buffer, &p_current );
//fprintf( stderr, "VTS %d title_inf Pgc: %d Prg: %d\n", i,title_inf.p_title_start[i].i_program_chain_num, title_inf.p_title_start[i].i_program_num ); //fprintf( stderr, "VTS %d title_inf Pgc: %d Prg: %d\n", i,title_inf.p_title_start[i].i_program_chain_num, title_inf.p_title_start[i].i_program_num );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing * dvd_ifo.h: Structures for ifo parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.h,v 1.13 2001/04/20 05:40:03 stef Exp $ * $Id: dvd_ifo.h,v 1.14 2001/04/22 00:08:25 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -459,8 +459,8 @@ typedef struct vts_manager_s ...@@ -459,8 +459,8 @@ typedef struct vts_manager_s
* we have a pointer to this structure for each tts */ * we have a pointer to this structure for each tts */
typedef struct title_start_s typedef struct title_start_s
{ {
u16 i_program_chain_num; // 2 bytes; Chapters/PGs u16 i_title_id; // 2 bytes; Chapters/PGs
u16 i_program_num; // 2 bytes u16 i_chapter; // 2 bytes
} title_start_t; } title_start_t;
/* Main struct for tts /* Main struct for tts
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.48 2001/04/20 05:40:03 stef Exp $ * $Id: input_dvd.c,v 1.49 2001/04/22 00:08:25 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -242,14 +242,22 @@ lang_tbl[] = ...@@ -242,14 +242,22 @@ lang_tbl[] =
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
/* called from outside */
static int DVDProbe ( probedata_t *p_data ); static int DVDProbe ( probedata_t *p_data );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * ); static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * ); static void DVDEnd ( struct input_thread_s * );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDSetArea ( struct input_thread_s *, struct input_area_s * ); static int DVDSetArea ( struct input_thread_s *, struct input_area_s * );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * ); static int DVDRewind ( struct input_thread_s * );
/* called only inside */
static char * Language( u16 );
static int DVDChooseAngle( thread_dvd_data_t * );
static int DVDFindCell( thread_dvd_data_t * );
static int DVDFindSector( thread_dvd_data_t * );
static int DVDChapterSelect( thread_dvd_data_t *, int );
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much. * we don't pollute the namespace too much.
...@@ -340,138 +348,187 @@ static int DVDProbe( probedata_t *p_data ) ...@@ -340,138 +348,187 @@ static int DVDProbe( probedata_t *p_data )
} }
/***************************************************************************** /*****************************************************************************
* DVDFindCell: adjust the title cell index with the program cell * DVDInit: initializes DVD structures
*****************************************************************************/ *****************************************************************************/
static int DVDFindCell( thread_dvd_data_t * p_dvd ) static void DVDInit( input_thread_t * p_input )
{ {
int i_cell; thread_dvd_data_t * p_dvd;
int i_index; input_area_t * p_area;
int i_title;
#define title \ int i_chapter;
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title int i;
#define cell p_dvd->p_ifo->vts.cell_inf
i_cell = p_dvd->i_cell; /* I don't want DVDs to start playing immediately */
i_index = p_dvd->i_prg_cell; // p_input->stream.i_new_status = PAUSE_S;
if( i_cell >= cell.i_cell_nb ) p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
{ {
return -1; intf_ErrMsg( "dvd error: out of memory" );
p_input->b_error = 1;
return;
} }
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
p_dvd->i_fd = p_input->i_handle;
while( ( ( title.p_cell_pos[i_index].i_vob_id != /* reading several block once seems to cause lock-up
cell.p_cell_map[i_cell].i_vob_id ) || * when using input_ToggleES
( title.p_cell_pos[i_index].i_cell_id != * who wrote thez damn buggy piece of shit ??? --stef */
cell.p_cell_map[i_cell].i_cell_id ) ) && p_dvd->i_block_once = 1;//32;
( i_cell < cell.i_cell_nb - 1 ) ) p_input->i_read_once = 8;//128;
i = CSSTest( p_input->i_handle );
if( i < 0 )
{ {
i_cell++; free( p_dvd );
p_input->b_error = 1;
return;
} }
intf_WarnMsg( 1, "FindCell: i_cell %d i_index %d found %d nb %d", p_dvd->b_encrypted = i;
p_dvd->i_cell,
p_dvd->i_prg_cell,
i_cell,
cell.i_cell_nb );
p_dvd->i_cell = i_cell; lseek( p_input->i_handle, 0, SEEK_SET );
return 0;
#undef title /* Reading structures initialisation */
#undef cell p_input->p_method_data =
} DVDNetlistInit( 2048, 8192, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/***************************************************************************** /* Ifo allocation & initialisation */
* DVDFindSector: find cell index in adress map from index in if( IfoCreate( p_dvd ) < 0 )
* information table program map and give corresponding sectors. {
*****************************************************************************/ intf_ErrMsg( "dvd error: allcation error in ifo" );
static int DVDFindSector( thread_dvd_data_t * p_dvd ) p_input->b_error = 1;
{ return;
#define title \ }
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
if( p_dvd->i_sector > title.p_cell_play[p_dvd->i_prg_cell].i_end_sector ) if( IfoInit( p_dvd->p_ifo ) < 0 )
{ {
p_dvd->i_prg_cell++; intf_ErrMsg( "dvd error: fatal failure in ifo" );
free( p_dvd );
p_input->b_error = 1;
return;
}
/* basic handling of angles */ /* CSS initialisation */
switch( ( ( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 ) if( p_dvd->b_encrypted )
>> 12 ) )
{ {
case 0x5: p_dvd->p_css = malloc( sizeof(css_t) );
p_dvd->i_prg_cell += p_dvd->i_angle - 1; if( p_dvd->p_css == NULL )
intf_WarnMsg( 1, "dvd info: choosing angle %d", p_dvd->i_angle ); {
break; intf_ErrMsg( "dvd error: couldn't create css structure" );
case 0x9: free( p_dvd );
case 0xd: p_input->b_error = 1;
p_dvd->i_prg_cell += p_dvd->i_angle_nb - p_dvd->i_angle; return;
break; }
p_dvd->p_css->i_agid = 0;
if( CSSInit( p_input->i_handle, p_dvd->p_css ) < 0 )
{
intf_ErrMsg( "dvd error: fatal failure in css" );
free( p_dvd->p_css );
free( p_dvd );
p_input->b_error = 1;
return;
} }
intf_WarnMsg( 2, "dvd info: css initialized" );
} }
if( DVDFindCell( p_dvd ) < 0 ) /* Set stream and area data */
vlc_mutex_lock( &p_input->stream.stream_lock );
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
/* disc input method */
p_input->stream.i_method = INPUT_METHOD_DVD;
#define title_inf p_dvd->p_ifo->vmg.title_inf
intf_WarnMsg( 2, "dvd info: number of titles: %d", title_inf.i_title_nb );
#define area p_input->stream.pp_areas
/* We start from 1 here since the default area 0
* is reserved for video_ts.vob */
for( i = 1 ; i <= title_inf.i_title_nb ; i++ )
{ {
intf_ErrMsg( "dvd error: can't find sector" ); input_AddArea( p_input );
return -1;
/* Titles are Program Chains */
area[i]->i_id = i;
/* Absolute start offset and size
* We can only set that with vts ifo, so we do it during the
* first call to DVDSetArea */
area[i]->i_start = 0;
area[i]->i_size = 0;
/* Number of chapters */
area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
area[i]->i_part = 1;
/* Number of angles */
area[i]->i_angle_nb = 0;
area[i]->i_angle = 1;
/* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_off +
( title_inf.p_attr[i-1].i_start_sector * DVD_LB_SIZE );
} }
#undef area
/* Find start and end sectors of new cell */ /* Get requested title - if none try the first title */
p_dvd->i_sector = MAX( i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector, if( i_title <= 0 || i_title > title_inf.i_title_nb )
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector ); {
p_dvd->i_end_sector = MIN( i_title = 1;
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector, }
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
intf_WarnMsg( 1, "cell: %d sector1: 0x%x end1: 0x%x\n" #undef title_inf
"index: %d sector2: 0x%x end2: 0x%x\n"
"category: 0x%x ilvu end: 0x%x vobu start 0x%x",
p_dvd->i_cell,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
p_dvd->i_prg_cell,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_category,
title.p_cell_play[p_dvd->i_prg_cell].i_first_ilvu_vobu_esector,
title.p_cell_play[p_dvd->i_prg_cell].i_last_vobu_start_sector );
#undef title /* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
if( i_chapter <= 0 )
{
i_chapter = 1;
}
return 0; p_input->stream.pp_areas[i_title]->i_part = i_chapter;
p_area = p_input->stream.pp_areas[i_title];
vlc_mutex_unlock( &p_input->stream.stream_lock );
/* set title, chapter, audio and subpic */
DVDSetArea( p_input, p_area );
return;
} }
/***************************************************************************** /*****************************************************************************
* DVDChapterSelect: find the cell corresponding to requested chapter * DVDEnd: frees unused data
*****************************************************************************/ *****************************************************************************/
static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter ) static void DVDEnd( input_thread_t * p_input )
{ {
#define title \ thread_dvd_data_t * p_dvd;
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title dvd_netlist_t * p_netlist;
/* Find cell index in Program chain for current chapter */ p_dvd = (thread_dvd_data_t*)p_input->p_plugin_data;
p_dvd->i_prg_cell = title.chapter_map.pi_start_cell[i_chapter-1] - 1; p_netlist = (dvd_netlist_t *)p_input->p_method_data;
p_dvd->i_cell = 0;
p_dvd->i_sector = 0;
/* Search for cell_index in cell adress_table and initialize start sector */ if( p_dvd->b_encrypted )
if( DVDFindSector( p_dvd ) < 0 )
{ {
intf_ErrMsg( "dvd error: can't select chapter" ); free( p_dvd->p_css );
return -1;
} }
/* start is : beginning of vts vobs + offset to vob x */ IfoDestroy( p_dvd->p_ifo );
p_dvd->i_start = p_dvd->i_title_start + free( p_dvd );
DVD_LB_SIZE * (off_t)( p_dvd->i_sector ); DVDNetlistEnd( p_netlist );
/* Position the fd pointer on the right address */
p_dvd->i_start = lseek( p_dvd->i_fd, p_dvd->i_start, SEEK_SET );
p_dvd->i_chapter = i_chapter;
#undef title
return 0;
} }
/***************************************************************************** /*****************************************************************************
...@@ -536,13 +593,13 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -536,13 +593,13 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* title position inside the selected vts */ /* title position inside the selected vts */
p_dvd->i_vts_title = p_dvd->i_vts_title =
vmg.title_inf.p_attr[p_dvd->i_title-1].i_title_num; vmg.title_inf.p_attr[p_dvd->i_title-1].i_title_num;
p_dvd->i_program_chain = p_dvd->i_title_id =
vts.title_inf.p_title_start[p_dvd->i_vts_title-1].i_program_chain_num; vts.title_inf.p_title_start[p_dvd->i_vts_title-1].i_title_id;
intf_WarnMsg( 1, "dvd: title %d vts_title %d pgc %d", intf_WarnMsg( 1, "dvd: title %d vts_title %d pgc %d",
p_dvd->i_title, p_dvd->i_title,
p_dvd->i_vts_title, p_dvd->i_vts_title,
p_dvd->i_program_chain ); p_dvd->i_title_id );
/* css title key for current vts */ /* css title key for current vts */
if( p_dvd->b_encrypted ) if( p_dvd->b_encrypted )
...@@ -592,7 +649,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -592,7 +649,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* last video cell */ /* last video cell */
p_dvd->i_cell = 0; p_dvd->i_cell = 0;
p_dvd->i_prg_cell = -1 + p_dvd->i_prg_cell = -1 +
vts.title_unit.p_title[p_dvd->i_program_chain-1].title.i_cell_nb; vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
if( DVDFindCell( p_dvd ) < 0 ) if( DVDFindCell( p_dvd ) < 0 )
{ {
...@@ -685,7 +742,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -685,7 +742,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ ) for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
{ {
//#ifdef DEBUG #ifdef DEBUG
intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i, intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i,
vts.manager_inf.p_audio_attr[i-1].i_num_channels, vts.manager_inf.p_audio_attr[i-1].i_num_channels,
vts.manager_inf.p_audio_attr[i-1].i_coding_mode, vts.manager_inf.p_audio_attr[i-1].i_coding_mode,
...@@ -699,7 +756,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -699,7 +756,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vts.manager_inf.p_audio_attr[i-1].i_sample_freq, vts.manager_inf.p_audio_attr[i-1].i_sample_freq,
vts.manager_inf.p_audio_attr[i-1].i_lang_code, vts.manager_inf.p_audio_attr[i-1].i_lang_code,
vts.manager_inf.p_audio_attr[i-1].i_caption ); vts.manager_inf.p_audio_attr[i-1].i_caption );
//#endif #endif
switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode ) switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode )
{ {
...@@ -813,13 +870,18 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -813,13 +870,18 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
{ {
p_area = p_input->stream.p_selected_area; p_area = p_input->stream.p_selected_area;
} }
#undef vts
#undef vmg
/* /*
* Chapter selection * Chapter selection
*/ */
if( p_area->i_part != p_dvd->i_chapter )
{
if( ( p_area->i_part > 0 ) && if( ( p_area->i_part > 0 ) &&
( p_area->i_part <= p_area->i_part_nb ) ) ( p_area->i_part <= p_area->i_part_nb ))
{ {
if( DVDChapterSelect( p_dvd, p_area->i_part ) < 0 ) if( DVDChapterSelect( p_dvd, p_area->i_part ) < 0 )
{ {
...@@ -835,197 +897,42 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -835,197 +897,42 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld", intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld",
p_area->i_part, p_area->i_tell ); p_area->i_part, p_area->i_tell );
} }
else
{
p_area->i_part = 1;
p_dvd->i_chapter = 1;
}
}
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
vlc_mutex_unlock( &p_input->stream.stream_lock ); if( p_area->i_angle != p_dvd->i_angle )
#undef vts
#undef vmg
return 0;
}
/*****************************************************************************
* DVDInit: initializes DVD structures
*****************************************************************************/
static void DVDInit( input_thread_t * p_input )
{
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
int i_title;
int i_chapter;
int i;
/* I don't want DVDs to start playing immediately */
// p_input->stream.i_new_status = PAUSE_S;
p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
{ {
intf_ErrMsg( "dvd error: out of memory" ); if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
p_input->b_error = 1;
return;
}
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
p_dvd->i_fd = p_input->i_handle;
/* reading several block once seems to cause lock-up
* when using input_ToggleES
* who wrote thez damn buggy piece of shit ??? --stef */
p_dvd->i_block_once = 1;//32;
p_input->i_read_once = 8;//128;
i = CSSTest( p_input->i_handle );
if( i < 0 )
{ {
free( p_dvd ); if( ( p_area->i_angle - p_dvd->i_angle ) < 0 )
p_input->b_error = 1;
return;
}
p_dvd->b_encrypted = i;
lseek( p_input->i_handle, 0, SEEK_SET );
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 2048, 8192, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo allocation & initialisation */
if( IfoCreate( p_dvd ) < 0 )
{
intf_ErrMsg( "dvd error: allcation error in ifo" );
p_input->b_error = 1;
return;
}
if( IfoInit( p_dvd->p_ifo ) < 0 )
{
intf_ErrMsg( "dvd error: fatal failure in ifo" );
free( p_dvd );
p_input->b_error = 1;
return;
}
/* CSS initialisation */
if( p_dvd->b_encrypted )
{
p_dvd->p_css = malloc( sizeof(css_t) );
if( p_dvd->p_css == NULL )
{ {
intf_ErrMsg( "dvd error: couldn't create css structure" ); p_dvd->i_cell = 0;
free( p_dvd );
p_input->b_error = 1;
return;
}
p_dvd->p_css->i_agid = 0;
if( CSSInit( p_input->i_handle, p_dvd->p_css ) < 0 )
{
intf_ErrMsg( "dvd error: fatal failure in css" );
free( p_dvd->p_css );
free( p_dvd );
p_input->b_error = 1;
return;
}
intf_WarnMsg( 2, "dvd info: css initialized" );
} }
p_dvd->i_prg_cell += ( p_area->i_angle - p_dvd->i_angle );
p_dvd->i_angle = p_area->i_angle;
/* Set stream and area data */ DVDFindSector( p_dvd );
vlc_mutex_lock( &p_input->stream.stream_lock ); p_dvd->i_cell += p_dvd->i_angle_cell;
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
/* disc input method */
p_input->stream.i_method = INPUT_METHOD_DVD;
#define title_inf p_dvd->p_ifo->vmg.title_inf
intf_WarnMsg( 2, "dvd info: number of titles: %d", title_inf.i_title_nb );
#define area p_input->stream.pp_areas
/* We start from 1 here since the default area 0
* is reserved for video_ts.vob */
for( i = 1 ; i <= title_inf.i_title_nb ; i++ )
{
input_AddArea( p_input );
/* Titles are Program Chains */
area[i]->i_id = i;
/* Absolute start offset and size
* We can only set that with vts ifo, so we do it during the
* first call to DVDSetArea */
area[i]->i_start = 0;
area[i]->i_size = 0;
/* Number of chapters */
area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
area[i]->i_part = 1;
/* Number of angles */
area[i]->i_angle_nb = 0;
area[i]->i_angle = 1;
/* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_off +
( title_inf.p_attr[i-1].i_start_sector * DVD_LB_SIZE );
} }
#undef area else
/* Get requested title - if none try the first title */
i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
if( i_title <= 0 || i_title > title_inf.i_title_nb )
{ {
i_title = 1; p_dvd->i_angle = p_area->i_angle;
} }
#undef title_inf intf_WarnMsg( 2, "dvd info: angle %d selected", p_area->i_angle );
/* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
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];
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
/* set title, chapter, audio and subpic */ return 0;
DVDSetArea( p_input, p_area );
return;
} }
/*****************************************************************************
* DVDEnd: frees unused data
*****************************************************************************/
static void DVDEnd( input_thread_t * p_input )
{
thread_dvd_data_t * p_dvd;
dvd_netlist_t * p_netlist;
p_dvd = (thread_dvd_data_t*)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
if( p_dvd->b_encrypted )
{
free( p_dvd->p_css );
}
IfoDestroy( p_dvd->p_ifo );
free( p_dvd );
DVDNetlistEnd( p_netlist );
}
/***************************************************************************** /*****************************************************************************
* DVDRead: reads data packets into the netlist. * DVDRead: reads data packets into the netlist.
...@@ -1053,8 +960,6 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1053,8 +960,6 @@ static int DVDRead( input_thread_t * p_input,
p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data; p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data; p_netlist = (dvd_netlist_t *)p_input->p_method_data;
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
/* Get an iovec pointer */ /* Get an iovec pointer */
if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL ) if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL )
...@@ -1068,7 +973,10 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1068,7 +973,10 @@ static int DVDRead( input_thread_t * p_input,
/* Get the position of the next cell if we're at cell end */ /* Get the position of the next cell if we're at cell end */
if( i_block_once <= 0 ) if( i_block_once <= 0 )
{ {
int i_angle;
p_dvd->i_cell++; p_dvd->i_cell++;
p_dvd->i_angle_cell++;
/* Find cell index in adress map */ /* Find cell index in adress map */
if( DVDFindSector( p_dvd ) < 0 ) if( DVDFindSector( p_dvd ) < 0 )
...@@ -1085,8 +993,16 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1085,8 +993,16 @@ static int DVDRead( input_thread_t * p_input,
/* update chapter : it will be easier when we have navigation /* update chapter : it will be easier when we have navigation
* ES support */ * ES support */
if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
{
i_angle = p_dvd->i_angle - 1;
}
else
{
i_angle = 0;
}
if( title.chapter_map.pi_start_cell[p_dvd->i_chapter-1] <= if( title.chapter_map.pi_start_cell[p_dvd->i_chapter-1] <=
p_dvd->i_prg_cell ) ( p_dvd->i_prg_cell - i_angle ) )
{ {
p_dvd->i_chapter++; p_dvd->i_chapter++;
} }
...@@ -1134,6 +1050,7 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1134,6 +1050,7 @@ static int DVDRead( input_thread_t * p_input,
{ {
CSSDescrambleSector( p_dvd->p_css->pi_title_key, CSSDescrambleSector( p_dvd->p_css->pi_title_key,
p_vec[i_iovec].iov_base ); p_vec[i_iovec].iov_base );
((u8*)(p_vec[i_iovec].iov_base))[0x14] &= 0x8F;
} }
i_pos = 0; i_pos = 0;
...@@ -1209,10 +1126,8 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1209,10 +1126,8 @@ static int DVDRead( input_thread_t * p_input,
{ {
return 1; return 1;
} }
#undef title
} }
/***************************************************************************** /*****************************************************************************
* DVDRewind : reads a stream backward * DVDRewind : reads a stream backward
*****************************************************************************/ *****************************************************************************/
...@@ -1235,10 +1150,9 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -1235,10 +1150,9 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
int i_prg_cell; int i_prg_cell;
int i_cell; int i_cell;
int i_chapter; int i_chapter;
int i_angle;
p_dvd = ( thread_dvd_data_t * )p_input->p_plugin_data; p_dvd = ( thread_dvd_data_t * )p_input->p_plugin_data;
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
/* we have to take care of offset of beginning of title */ /* we have to take care of offset of beginning of title */
i_pos = i_off + p_input->stream.p_selected_area->i_start i_pos = i_off + p_input->stream.p_selected_area->i_start
...@@ -1257,6 +1171,13 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -1257,6 +1171,13 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
} }
p_dvd->i_prg_cell = i_prg_cell; p_dvd->i_prg_cell = i_prg_cell;
if( DVDChooseAngle( p_dvd ) < 0 )
{
p_input->b_error = 1;
return;
}
p_dvd->i_cell = 0; p_dvd->i_cell = 0;
/* Find first title cell which is inside program cell */ /* Find first title cell which is inside program cell */
...@@ -1279,12 +1200,31 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -1279,12 +1200,31 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
p_dvd->i_cell = i_cell; p_dvd->i_cell = i_cell;
/* if we're inside a multi-angle zone, we have to choose i_sector
* in the current angle ; we can't do it all the time since cells
* can be very wide out of such zones */
if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
{
p_dvd->i_sector = MAX(
cell.i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
}
p_dvd->i_end_sector = MIN( p_dvd->i_end_sector = MIN(
cell.i_end_sector, cell.i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector ); title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
#undef cell
/* update chapter */ /* update chapter */
while( title.chapter_map.pi_start_cell[i_chapter-1] <= p_dvd->i_prg_cell ) if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
{
i_angle = p_dvd->i_angle - 1;
}
else
{
i_angle = 0;
}
while( title.chapter_map.pi_start_cell[i_chapter-1] <=
( p_dvd->i_prg_cell - i_angle ) )
{ {
i_chapter++; i_chapter++;
} }
...@@ -1296,9 +1236,159 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -1296,9 +1236,159 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
lseek( p_dvd->i_fd, p_dvd->i_title_start + lseek( p_dvd->i_fd, p_dvd->i_title_start +
(off_t)( p_dvd->i_sector ) *DVD_LB_SIZE, SEEK_SET ) - (off_t)( p_dvd->i_sector ) *DVD_LB_SIZE, SEEK_SET ) -
p_input->stream.p_selected_area->i_start; p_input->stream.p_selected_area->i_start;
/*
intf_WarnMsg( 1, "Program Cell: %d Cell: %d Chapter: %d", intf_WarnMsg( 1, "Program Cell: %d Cell: %d Chapter: %d",
i_prg_cell, i_cell, p_dvd->i_chapter ); p_dvd->i_prg_cell, p_dvd->i_cell, p_dvd->i_chapter );
*/
return; return;
} }
#define cell p_dvd->p_ifo->vts.cell_inf
/*****************************************************************************
* DVDFindCell: adjust the title cell index with the program cell
*****************************************************************************/
static int DVDFindCell( thread_dvd_data_t * p_dvd )
{
int i_cell;
int i_index;
i_cell = p_dvd->i_cell;
i_index = p_dvd->i_prg_cell;
if( i_cell >= cell.i_cell_nb )
{
return -1;
}
while( ( ( title.p_cell_pos[i_index].i_vob_id !=
cell.p_cell_map[i_cell].i_vob_id ) ||
( title.p_cell_pos[i_index].i_cell_id !=
cell.p_cell_map[i_cell].i_cell_id ) ) &&
( i_cell < cell.i_cell_nb - 1 ) )
{
i_cell++;
}
/*
intf_WarnMsg( 1, "FindCell: i_cell %d i_index %d found %d nb %d",
p_dvd->i_cell,
p_dvd->i_prg_cell,
i_cell,
cell.i_cell_nb );
*/
p_dvd->i_cell = i_cell;
return 0;
}
#undef cell
/*****************************************************************************
* DVDFindSector: find cell index in adress map from index in
* information table program map and give corresponding sectors.
*****************************************************************************/
static int DVDFindSector( thread_dvd_data_t * p_dvd )
{
if( p_dvd->i_sector > title.p_cell_play[p_dvd->i_prg_cell].i_end_sector )
{
p_dvd->i_prg_cell++;
if( DVDChooseAngle( p_dvd ) < 0 )
{
return -1;
}
}
if( DVDFindCell( p_dvd ) < 0 )
{
intf_ErrMsg( "dvd error: can't find sector" );
return -1;
}
/* Find start and end sectors of new cell */
p_dvd->i_sector = MAX(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
p_dvd->i_end_sector = MIN(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
/*
intf_WarnMsg( 1, "cell: %d sector1: 0x%x end1: 0x%x\n"
"index: %d sector2: 0x%x end2: 0x%x\n"
"category: 0x%x ilvu end: 0x%x vobu start 0x%x",
p_dvd->i_cell,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
p_dvd->i_prg_cell,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_category,
title.p_cell_play[p_dvd->i_prg_cell].i_first_ilvu_vobu_esector,
title.p_cell_play[p_dvd->i_prg_cell].i_last_vobu_start_sector );
*/
return 0;
}
/*****************************************************************************
* DVDChapterSelect: find the cell corresponding to requested chapter
*****************************************************************************/
static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter )
{
/* Find cell index in Program chain for current chapter */
p_dvd->i_prg_cell = title.chapter_map.pi_start_cell[i_chapter-1] - 1;
p_dvd->i_cell = 0;
p_dvd->i_sector = 0;
DVDChooseAngle( p_dvd );
/* Search for cell_index in cell adress_table and initialize start sector */
if( DVDFindSector( p_dvd ) < 0 )
{
intf_ErrMsg( "dvd error: can't select chapter" );
return -1;
}
/* start is : beginning of vts vobs + offset to vob x */
p_dvd->i_start = p_dvd->i_title_start +
DVD_LB_SIZE * (off_t)( p_dvd->i_sector );
/* Position the fd pointer on the right address */
p_dvd->i_start = lseek( p_dvd->i_fd, p_dvd->i_start, SEEK_SET );
p_dvd->i_chapter = i_chapter;
return 0;
}
/*****************************************************************************
* DVDChooseAngle: select the cell corresponding to the selected angle
*****************************************************************************/
static int DVDChooseAngle( thread_dvd_data_t * p_dvd )
{
/* basic handling of angles */
switch( ( ( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
>> 12 ) )
{
/* we enter a muli-angle section */
case 0x5:
p_dvd->i_prg_cell += p_dvd->i_angle - 1;
p_dvd->i_angle_cell = 0;
// intf_WarnMsg( 1, "dvd info: choosing angle %d", p_dvd->i_angle );
break;
/* we exit a multi-angle section */
case 0x9:
case 0xd:
p_dvd->i_prg_cell += p_dvd->i_angle_nb - p_dvd->i_angle;
break;
}
return 0;
}
#undef title
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_dvd.h: thread structure of the DVD plugin * input_dvd.h: thread structure of the DVD plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_dvd.h,v 1.20 2001/04/20 05:40:03 stef Exp $ * $Id: input_dvd.h,v 1.21 2001/04/22 00:08:26 stef Exp $
* *
* Author: Stéphane Borel <stef@via.ecp.fr> * Author: Stéphane Borel <stef@via.ecp.fr>
* *
...@@ -41,13 +41,14 @@ typedef struct thread_dvd_data_s ...@@ -41,13 +41,14 @@ typedef struct thread_dvd_data_s
/* Navigation information */ /* Navigation information */
int i_title; int i_title;
int i_vts_title; int i_vts_title;
int i_program_chain; int i_title_id;
int i_chapter_nb; int i_chapter_nb;
int i_chapter; int i_chapter;
int i_angle_nb; int i_angle_nb;
int i_angle; int i_angle;
int i_angle_cell; /* cell index in the current angle */
int i_cell; /* cell index in adress map */ int i_cell; /* cell index in adress map */
int i_prg_cell; /* cell index in program map */ int i_prg_cell; /* cell index in program map */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin. * gnome_callbacks.c : Callbacks for the Gnome plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.23 2001/04/20 05:40:03 stef Exp $ * $Id: gnome_callbacks.c,v 1.24 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -408,6 +408,25 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem, ...@@ -408,6 +408,25 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
} }
void
on_menubar_angle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
gint i_angle = (gint)user_data;
if( menuitem->active && !p_intf->p_sys->b_angle_update )
{
p_area->i_angle = i_angle;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_angle_update = 1;
}
}
void void
on_menubar_modules_activate (GtkMenuItem *menuitem, on_menubar_modules_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -745,6 +764,24 @@ on_popup_navigation_toggle (GtkCheckMenuItem *menuitem, ...@@ -745,6 +764,24 @@ on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
} }
void
on_popup_angle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
gint i_angle = (gint)user_data;
if( menuitem->active && !p_intf->p_sys->b_angle_update )
{
p_area->i_angle = i_angle;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_angle_update = 1;
}
}
void void
on_popup_open_activate (GtkMenuItem *menuitem, on_popup_open_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -846,11 +883,10 @@ on_fileopen_ok_clicked (GtkButton *button, ...@@ -846,11 +883,10 @@ on_fileopen_ok_clicked (GtkButton *button,
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename );
/* Select added item and switch to file interface */ /* Select added item and switch to file interface */
intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
if( p_intf->p_input != NULL ) if( p_intf->p_input != NULL )
p_intf->p_input->b_eof = 1; p_intf->p_input->b_eof = 1;
p_intf->p_sys->i_intf_mode = FILE_MODE;
p_intf->p_sys->b_mode_changed = 1; // p_intf->p_sys->b_mode_changed = 1;
} }
...@@ -1018,7 +1054,7 @@ on_disc_ok_clicked (GtkButton *button, ...@@ -1018,7 +1054,7 @@ on_disc_ok_clicked (GtkButton *button,
intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 ); intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
if( p_intf->p_input != NULL ) if( p_intf->p_input != NULL )
p_intf->p_input->b_eof = 1; p_intf->p_input->b_eof = 1;
p_intf->p_sys->b_mode_changed = 1; // p_intf->p_sys->b_mode_changed = 1;
gtk_widget_hide( p_intf->p_sys->p_disc ); gtk_widget_hide( p_intf->p_sys->p_disc );
} }
...@@ -1089,8 +1125,7 @@ on_network_ok_clicked (GtkButton *button, ...@@ -1089,8 +1125,7 @@ on_network_ok_clicked (GtkButton *button,
intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 ); intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
if( p_intf->p_input != NULL ) if( p_intf->p_input != NULL )
p_intf->p_input->b_eof = 1; p_intf->p_input->b_eof = 1;
p_intf->p_sys->b_mode_changed = 1; // p_intf->p_sys->b_mode_changed = 1;
p_intf->p_sys->i_intf_mode = NET_MODE;
gtk_widget_hide( p_intf->p_sys->p_network ); gtk_widget_hide( p_intf->p_sys->p_network );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gnome_callbacks.h : Callbacks for the Gnome plugin. * gnome_callbacks.h : Callbacks for the Gnome plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.h,v 1.14 2001/04/08 07:24:47 stef Exp $ * $Id: gnome_callbacks.h,v 1.15 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -289,3 +289,11 @@ on_button_title_prev_clicked (GtkButton *button, ...@@ -289,3 +289,11 @@ on_button_title_prev_clicked (GtkButton *button,
void void
on_button_title_next_clicked (GtkButton *button, on_button_title_next_clicked (GtkButton *button,
gpointer user_data); gpointer user_data);
void
on_menubar_angle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_popup_angle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
...@@ -49,14 +49,21 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] = ...@@ -49,14 +49,21 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] =
{ {
{ {
GNOME_APP_UI_ITEM, N_("_Title"), GNOME_APP_UI_ITEM, N_("_Title"),
NULL, N_("Choose title"),
(gpointer) NULL, NULL, NULL, (gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
}, },
{ {
GNOME_APP_UI_ITEM, N_("_Chapter"), GNOME_APP_UI_ITEM, N_("_Chapter"),
NULL, N_("Choose chapter"),
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("An_gle"),
N_("Choose angle"),
(gpointer) NULL, NULL, NULL, (gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
...@@ -154,13 +161,10 @@ create_intf_window (void) ...@@ -154,13 +161,10 @@ create_intf_window (void)
GtkWidget *button_chapter_prev; GtkWidget *button_chapter_prev;
GtkWidget *button_chapter_next; GtkWidget *button_chapter_next;
GtkWidget *network_box; GtkWidget *network_box;
GtkWidget *network_channel_box;
GtkWidget *label_network; GtkWidget *label_network;
GtkWidget *button_network_channel_1; GtkObject *network_spinbutton_adj;
GtkWidget *button_network_channel_2; GtkWidget *network_spinbutton;
GtkWidget *button_network_channel_3;
GtkWidget *button_network_channel_4;
GtkWidget *button_network_channel_5;
GtkWidget *button_network_channel_6;
GtkWidget *appbar; GtkWidget *appbar;
GtkTooltips *tooltips; GtkTooltips *tooltips;
...@@ -225,22 +229,28 @@ create_intf_window (void) ...@@ -225,22 +229,28 @@ create_intf_window (void)
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[1].widget, FALSE); gtk_widget_set_sensitive (menubar_view_menu_uiinfo[1].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[2].widget); gtk_widget_ref (menubar_view_menu_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle",
menubar_view_menu_uiinfo[2].widget, menubar_view_menu_uiinfo[2].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[2].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[3].widget); gtk_widget_ref (menubar_view_menu_uiinfo[3].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist", gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
menubar_view_menu_uiinfo[3].widget, menubar_view_menu_uiinfo[3].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[3].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[4].widget); gtk_widget_ref (menubar_view_menu_uiinfo[4].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
menubar_view_menu_uiinfo[4].widget, menubar_view_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[4].widget, FALSE); gtk_widget_set_sensitive (menubar_view_menu_uiinfo[4].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[5].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
menubar_view_menu_uiinfo[5].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[5].widget, FALSE);
gtk_widget_ref (menubar_uiinfo[2].widget); gtk_widget_ref (menubar_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings",
menubar_uiinfo[2].widget, menubar_uiinfo[2].widget,
...@@ -455,6 +465,7 @@ create_intf_window (void) ...@@ -455,6 +465,7 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox4); gtk_widget_show (hbox4);
gtk_box_pack_start (GTK_BOX (vbox2), hbox4, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox2), hbox4, TRUE, TRUE, 0);
gtk_widget_set_usize (hbox4, 650, -2);
label_date = gtk_label_new (_("-:--:--")); label_date = gtk_label_new (_("-:--:--"));
gtk_widget_ref (label_date); gtk_widget_ref (label_date);
...@@ -468,7 +479,8 @@ create_intf_window (void) ...@@ -468,7 +479,8 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_status", label_status, gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_status", label_status,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_status); gtk_widget_show (label_status);
gtk_box_pack_start (GTK_BOX (hbox4), label_status, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox4), label_status, FALSE, FALSE, 0);
gtk_widget_set_usize (label_status, 350, -2);
label_bar = gtk_label_new (_("Bar: baz")); label_bar = gtk_label_new (_("Bar: baz"));
gtk_widget_ref (label_bar); gtk_widget_ref (label_bar);
...@@ -585,73 +597,34 @@ create_intf_window (void) ...@@ -585,73 +597,34 @@ create_intf_window (void)
gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL); gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL);
gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE);
network_box = gtk_hbox_new (FALSE, 0); network_box = gtk_hbox_new (TRUE, 0);
gtk_widget_ref (network_box); gtk_widget_ref (network_box);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_box", network_box, gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_box", network_box,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (vbox2), network_box, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox2), network_box, TRUE, TRUE, 0);
gtk_widget_set_usize (network_box, -2, 24);
network_channel_box = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (network_channel_box);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_box", network_channel_box,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_box);
gtk_box_pack_start (GTK_BOX (network_box), network_channel_box, TRUE, TRUE, 0);
label_network = gtk_label_new (_("Network Channel:")); label_network = gtk_label_new (_("Network Channel:"));
gtk_widget_ref (label_network); gtk_widget_ref (label_network);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_network", label_network, gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_network", label_network,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_network); gtk_widget_show (label_network);
gtk_box_pack_start (GTK_BOX (network_box), label_network, TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (network_channel_box), label_network, TRUE, FALSE, 0);
button_network_channel_1 = gtk_toggle_button_new_with_label (_("Channel 1")); network_spinbutton_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10);
gtk_widget_ref (button_network_channel_1); network_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_spinbutton_adj), 1, 0);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_1", button_network_channel_1, gtk_widget_ref (network_spinbutton);
(GtkDestroyNotify) gtk_widget_unref); gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_spinbutton", network_spinbutton,
gtk_widget_show (button_network_channel_1); (GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_1, FALSE, TRUE, 2); gtk_widget_show (network_spinbutton);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_1), GTK_RELIEF_HALF); gtk_box_pack_start (GTK_BOX (network_channel_box), network_spinbutton, FALSE, TRUE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_network_channel_1), TRUE); gtk_widget_set_sensitive (network_spinbutton, FALSE);
button_network_channel_2 = gtk_toggle_button_new_with_label (_("Channel 2"));
gtk_widget_ref (button_network_channel_2);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_2", button_network_channel_2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_network_channel_2);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_2, FALSE, TRUE, 2);
gtk_widget_set_sensitive (button_network_channel_2, FALSE);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_2), GTK_RELIEF_HALF);
button_network_channel_3 = gtk_toggle_button_new_with_label (_("Channel 3"));
gtk_widget_ref (button_network_channel_3);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_3", button_network_channel_3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_network_channel_3);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_3, FALSE, TRUE, 2);
gtk_widget_set_sensitive (button_network_channel_3, FALSE);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_3), GTK_RELIEF_HALF);
button_network_channel_4 = gtk_toggle_button_new_with_label (_("Channel 4"));
gtk_widget_ref (button_network_channel_4);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_4", button_network_channel_4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_network_channel_4);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_4, FALSE, TRUE, 2);
gtk_widget_set_sensitive (button_network_channel_4, FALSE);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_4), GTK_RELIEF_HALF);
button_network_channel_5 = gtk_toggle_button_new_with_label (_("Channel 5"));
gtk_widget_ref (button_network_channel_5);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_5", button_network_channel_5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_network_channel_5);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_5, FALSE, TRUE, 2);
gtk_widget_set_sensitive (button_network_channel_5, FALSE);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_5), GTK_RELIEF_HALF);
button_network_channel_6 = gtk_toggle_button_new_with_label (_("Channel 6"));
gtk_widget_ref (button_network_channel_6);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_6", button_network_channel_6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_network_channel_6);
gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_6, FALSE, TRUE, 2);
gtk_widget_set_sensitive (button_network_channel_6, FALSE);
gtk_button_set_relief (GTK_BUTTON (button_network_channel_6), GTK_RELIEF_HALF);
appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER); appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar); gtk_widget_ref (appbar);
...@@ -793,6 +766,13 @@ static GnomeUIInfo intf_popup_uiinfo[] = ...@@ -793,6 +766,13 @@ static GnomeUIInfo intf_popup_uiinfo[] =
GNOME_APP_PIXMAP_NONE, NULL, GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
}, },
{
GNOME_APP_UI_ITEM, N_("An_gle"),
NULL,
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{ {
GNOME_APP_UI_ITEM, N_("_Audio"), GNOME_APP_UI_ITEM, N_("_Audio"),
N_("Select audio channel"), N_("Select audio channel"),
...@@ -855,21 +835,27 @@ create_intf_popup (void) ...@@ -855,21 +835,27 @@ create_intf_popup (void)
gtk_widget_set_sensitive (intf_popup_uiinfo[5].widget, FALSE); gtk_widget_set_sensitive (intf_popup_uiinfo[5].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[6].widget); gtk_widget_ref (intf_popup_uiinfo[6].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_angle",
intf_popup_uiinfo[6].widget, intf_popup_uiinfo[6].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (intf_popup_uiinfo[6].widget, FALSE); gtk_widget_set_sensitive (intf_popup_uiinfo[6].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[7].widget); gtk_widget_ref (intf_popup_uiinfo[7].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio",
intf_popup_uiinfo[7].widget, intf_popup_uiinfo[7].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (intf_popup_uiinfo[7].widget, FALSE); gtk_widget_set_sensitive (intf_popup_uiinfo[7].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[8].widget); gtk_widget_ref (intf_popup_uiinfo[8].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle",
intf_popup_uiinfo[8].widget, intf_popup_uiinfo[8].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (intf_popup_uiinfo[8].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[9].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file",
intf_popup_uiinfo[9].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (popup_file_menu_uiinfo[0].widget); gtk_widget_ref (popup_file_menu_uiinfo[0].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open",
...@@ -896,14 +882,14 @@ create_intf_popup (void) ...@@ -896,14 +882,14 @@ create_intf_popup (void)
popup_file_menu_uiinfo[4].widget, popup_file_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[9].widget); gtk_widget_ref (intf_popup_uiinfo[10].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2",
intf_popup_uiinfo[9].widget, intf_popup_uiinfo[10].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[10].widget); gtk_widget_ref (intf_popup_uiinfo[11].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit",
intf_popup_uiinfo[10].widget, intf_popup_uiinfo[11].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
return intf_popup; return intf_popup;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface * intf_gnome.c: Gnome interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.31 2001/04/20 05:40:03 stef Exp $ * $Id: intf_gnome.c,v 1.32 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -71,6 +71,8 @@ static gint GnomeLanguageMenus( gpointer, GtkWidget *, es_descriptor_t *, gint, ...@@ -71,6 +71,8 @@ static gint GnomeLanguageMenus( gpointer, GtkWidget *, es_descriptor_t *, gint,
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) ); void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeChapterMenu ( gpointer, GtkWidget *, static gint GnomeChapterMenu ( gpointer, GtkWidget *,
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) ); void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeAngleMenu ( gpointer, GtkWidget *,
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeTitleMenu ( gpointer, GtkWidget *, static gint GnomeTitleMenu ( gpointer, GtkWidget *,
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) ); void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeSetupMenu ( intf_thread_t * p_intf ); static gint GnomeSetupMenu ( intf_thread_t * p_intf );
...@@ -153,18 +155,12 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -153,18 +155,12 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->b_popup_changed = 0; p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->b_window_changed = 0; p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_playlist_changed = 0;
p_intf->p_sys->b_title_update = 1;
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->b_slider_free = 1; p_intf->p_sys->b_slider_free = 1;
p_intf->p_sys->b_mode_changed = 1; p_intf->p_sys->b_mode_changed = 1;
p_intf->p_sys->i_intf_mode = FILE_MODE; p_intf->p_sys->i_intf_mode = FILE_MODE;
p_intf->p_sys->i_part = 0;
p_intf->p_sys->pf_gtk_callback = NULL; p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL; p_intf->p_sys->pf_gdk_callback = NULL;
...@@ -316,8 +312,10 @@ static gint GnomeManage( gpointer p_data ) ...@@ -316,8 +312,10 @@ static gint GnomeManage( gpointer p_data )
if( p_intf->p_input != NULL ) if( p_intf->p_input != NULL )
{ {
GtkWidget * p_slider;
float newvalue; float newvalue;
// vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
/* New input or stream map change */ /* New input or stream map change */
if( p_intf->p_input->stream.b_changed || p_intf->p_sys->b_mode_changed ) if( p_intf->p_input->stream.b_changed || p_intf->p_sys->b_mode_changed )
{ {
...@@ -336,13 +334,35 @@ static gint GnomeManage( gpointer p_data ) ...@@ -336,13 +334,35 @@ static gint GnomeManage( gpointer p_data )
intf_ErrMsg( "intf error: can't determine input method" ); intf_ErrMsg( "intf error: can't determine input method" );
break; break;
} }
p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "slider" ) );
if( p_intf->p_input->stream.b_seekable )
{
gtk_widget_show( GTK_WIDGET( p_slider ) );
}
else
{
gtk_widget_hide( GTK_WIDGET( p_slider ) );
}
/* get ready for menu regeneration */
p_intf->p_sys->b_title_update = 1;
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_angle_update = 1;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0;
p_intf->p_input->stream.b_changed = 0; p_intf->p_input->stream.b_changed = 0;
p_intf->p_sys->b_mode_changed = 0; p_intf->p_sys->b_mode_changed = 0;
intf_WarnMsg( 2, intf_WarnMsg( 2,
"Interface menus refreshed as stream has changed" ); "intf info: menus refreshed as stream has changed" );
} }
// vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
/* Update language/chapter menus after user request */ /* Update language/chapter menus after user request */
GnomeSetupMenu( p_intf ); GnomeSetupMenu( p_intf );
...@@ -520,6 +540,77 @@ static gint GnomeLanguageMenus( gpointer p_data, ...@@ -520,6 +540,77 @@ static gint GnomeLanguageMenus( gpointer p_data,
return TRUE; return TRUE;
} }
/*****************************************************************************
* GnomeAngleMenu: generate angle menu for current title
*****************************************************************************/
static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
char psz_name[10];
GtkWidget * p_angle_menu;
GSList * p_angle_group;
GtkWidget * p_item;
GtkWidget * p_item_active;
gint i_angle;
/* cast */
p_intf = (intf_thread_t*)p_data;
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_angle ) );
gtk_widget_set_sensitive( p_angle, FALSE );
p_angle_menu = gtk_menu_new();;
p_angle_group = NULL;
p_item = NULL;
p_item_active = NULL;
for( i_angle = 0 ;
i_angle < p_intf->p_input->stream.p_selected_area->i_angle_nb ;
i_angle++ )
{
sprintf( psz_name, "Angle %d", i_angle + 1 );
p_item = gtk_radio_menu_item_new_with_label( p_angle_group,
psz_name );
p_angle_group =
gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
if( p_intf->p_input->stream.p_selected_area->i_angle ==
( i_angle + 1 ) )
{
p_item_active = p_item;
}
gtk_widget_show( p_item );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)(i_angle + 1) );
gtk_menu_append( GTK_MENU( p_angle_menu ), p_item );
}
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_angle ), p_angle_menu );
if( p_item_active != NULL )
{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
TRUE );
}
/* be sure that menu is sensitive if non empty */
if( p_intf->p_input->stream.p_selected_area->i_angle_nb > 1 )
{
gtk_widget_set_sensitive( p_angle, TRUE );
}
return TRUE;
}
/***************************************************************************** /*****************************************************************************
* GnomeChapterMenu: generate chapter menu for current title * GnomeChapterMenu: generate chapter menu for current title
*****************************************************************************/ *****************************************************************************/
...@@ -662,6 +753,10 @@ static gint GnomeTitleMenu( gpointer p_data, ...@@ -662,6 +753,10 @@ static gint GnomeTitleMenu( gpointer p_data,
/* cast */ /* cast */
p_intf = (intf_thread_t*)p_data; p_intf = (intf_thread_t*)p_data;
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_navigation ) );
gtk_widget_set_sensitive( p_navigation, FALSE );
p_title_menu = gtk_menu_new(); p_title_menu = gtk_menu_new();
p_title_group = NULL; p_title_group = NULL;
p_title_submenu = NULL; p_title_submenu = NULL;
...@@ -845,8 +940,8 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) ...@@ -845,8 +940,8 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
GtkWidget * p_popup_menu; GtkWidget * p_popup_menu;
gint i; gint i;
p_intf->p_sys->b_title_update &= ( p_intf->p_input->stream.i_area_nb > 1 );
p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_angle_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update;
...@@ -883,9 +978,23 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) ...@@ -883,9 +978,23 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
p_intf->p_sys->i_part = p_intf->p_sys->i_part =
p_intf->p_input->stream.p_selected_area->i_part; p_intf->p_input->stream.p_selected_area->i_part;
p_intf->p_sys->b_chapter_update = 0; p_intf->p_sys->b_chapter_update = 0;
} }
if( p_intf->p_sys->b_angle_update )
{
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_angle" ) );
GnomeAngleMenu( p_intf, p_menubar_menu, on_menubar_angle_toggle );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_angle" ) );
GnomeAngleMenu( p_intf, p_popup_menu, on_popup_angle_toggle );
p_intf->p_sys->b_angle_update = 0;
}
/* look for selected ES */ /* look for selected ES */
p_audio_es = NULL; p_audio_es = NULL;
p_spu_es = NULL; p_spu_es = NULL;
...@@ -1006,7 +1115,7 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf ) ...@@ -1006,7 +1115,7 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf )
GtkWidget * p_dvd_box; GtkWidget * p_dvd_box;
GtkWidget * p_file_box; GtkWidget * p_file_box;
GtkWidget * p_network_box; GtkWidget * p_network_box;
// char * psz_name; char * psz_name;
p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_box" ) ); p_intf->p_sys->p_window ), "network_box" ) );
...@@ -1019,9 +1128,12 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf ) ...@@ -1019,9 +1128,12 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf )
p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "file_box" ) ); p_intf->p_sys->p_window ), "file_box" ) );
gtk_widget_show( GTK_WIDGET( p_file_box ) ); gtk_widget_show( GTK_WIDGET( p_file_box ) );
#if 0
psz_name = malloc( 16 + strlen( p_intf->p_input->p_source ) ); #if 1
sprintf( psz_name, "Status: playing %s", p_intf->p_input->p_source ); // psz_name = malloc( 16 + strlen( p_intf->p_input->p_source ) );
// sprintf( psz_name, "Status: playing %s", p_intf->p_input->p_source );
psz_name = strdup( p_intf->p_input->p_source );
gtk_label_set_text( p_intf->p_sys->p_label_status, psz_name ); gtk_label_set_text( p_intf->p_sys->p_label_status, psz_name );
......
...@@ -157,6 +157,7 @@ ...@@ -157,6 +157,7 @@
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>menubar_title</name> <name>menubar_title</name>
<sensitive>False</sensitive> <sensitive>False</sensitive>
<tooltip>Choose title</tooltip>
<label>_Title</label> <label>_Title</label>
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
...@@ -165,10 +166,20 @@ ...@@ -165,10 +166,20 @@
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>menubar_chapter</name> <name>menubar_chapter</name>
<sensitive>False</sensitive> <sensitive>False</sensitive>
<tooltip>Choose chapter</tooltip>
<label>_Chapter</label> <label>_Chapter</label>
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
<widget>
<class>GtkMenuItem</class>
<name>menubar_angle</name>
<sensitive>False</sensitive>
<tooltip>Choose angle</tooltip>
<label>An_gle</label>
<right_justify>False</right_justify>
</widget>
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>separator7</name> <name>separator7</name>
...@@ -491,6 +502,7 @@ ...@@ -491,6 +502,7 @@
<widget> <widget>
<class>GtkHBox</class> <class>GtkHBox</class>
<name>hbox4</name> <name>hbox4</name>
<width>650</width>
<homogeneous>True</homogeneous> <homogeneous>True</homogeneous>
<spacing>0</spacing> <spacing>0</spacing>
<child> <child>
...@@ -519,6 +531,7 @@ ...@@ -519,6 +531,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label_status</name> <name>label_status</name>
<width>350</width>
<label>Status: foo</label> <label>Status: foo</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -528,8 +541,8 @@ ...@@ -528,8 +541,8 @@
<ypad>0</ypad> <ypad>0</ypad>
<child> <child>
<padding>0</padding> <padding>0</padding>
<expand>True</expand> <expand>False</expand>
<fill>True</fill> <fill>False</fill>
</child> </child>
</widget> </widget>
...@@ -796,8 +809,26 @@ ...@@ -796,8 +809,26 @@
<widget> <widget>
<class>GtkHBox</class> <class>GtkHBox</class>
<name>network_box</name> <name>network_box</name>
<height>24</height>
<visible>False</visible> <visible>False</visible>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>Placeholder</class>
</widget>
<widget>
<class>Placeholder</class>
</widget>
<widget>
<class>GtkHBox</class>
<name>network_channel_box</name>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<spacing>0</spacing> <spacing>0</spacing>
<child> <child>
...@@ -824,92 +855,28 @@ ...@@ -824,92 +855,28 @@
</widget> </widget>
<widget> <widget>
<class>GtkToggleButton</class> <class>GtkSpinButton</class>
<name>button_network_channel_1</name> <name>network_spinbutton</name>
<can_focus>True</can_focus>
<label>Channel 1</label>
<relief>GTK_RELIEF_HALF</relief>
<active>True</active>
<child>
<padding>2</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkToggleButton</class>
<name>button_network_channel_2</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<label>Channel 2</label>
<relief>GTK_RELIEF_HALF</relief>
<active>False</active>
<child>
<padding>2</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkToggleButton</class>
<name>button_network_channel_3</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<label>Channel 3</label>
<relief>GTK_RELIEF_HALF</relief>
<active>False</active>
<child>
<padding>2</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkToggleButton</class>
<name>button_network_channel_4</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<label>Channel 4</label>
<relief>GTK_RELIEF_HALF</relief>
<active>False</active>
<child>
<padding>2</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkToggleButton</class>
<name>button_network_channel_5</name>
<sensitive>False</sensitive> <sensitive>False</sensitive>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<label>Channel 5</label> <climb_rate>1</climb_rate>
<relief>GTK_RELIEF_HALF</relief> <digits>0</digits>
<active>False</active> <numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap>
<wrap>False</wrap>
<value>1</value>
<lower>0</lower>
<upper>100</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child> <child>
<padding>2</padding> <padding>0</padding>
<expand>False</expand> <expand>False</expand>
<fill>True</fill> <fill>True</fill>
</child> </child>
</widget> </widget>
<widget>
<class>GtkToggleButton</class>
<name>button_network_channel_6</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<label>Channel 6</label>
<relief>GTK_RELIEF_HALF</relief>
<active>False</active>
<child>
<padding>2</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget> </widget>
</widget> </widget>
</widget> </widget>
...@@ -1000,6 +967,14 @@ ...@@ -1000,6 +967,14 @@
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
<widget>
<class>GtkMenuItem</class>
<name>popup_angle</name>
<sensitive>False</sensitive>
<label>An_gle</label>
<right_justify>False</right_justify>
</widget>
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>popup_audio</name> <name>popup_audio</name>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gnome.h: private Gnome interface description * intf_gnome.h: private Gnome interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.h,v 1.7 2001/04/20 05:40:03 stef Exp $ * $Id: intf_gnome.h,v 1.8 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -48,6 +48,7 @@ typedef struct intf_sys_s ...@@ -48,6 +48,7 @@ typedef struct intf_sys_s
boolean_t b_title_update; /* do we need to update title menus */ boolean_t b_title_update; /* do we need to update title menus */
boolean_t b_chapter_update; /* do we need to update boolean_t b_chapter_update; /* do we need to update
chapter menus */ chapter menus */
boolean_t b_angle_update; /* do we need to update angle menus */
boolean_t b_audio_update; /* do we need to update audio menus */ boolean_t b_audio_update; /* do we need to update audio menus */
boolean_t b_spu_update; /* do we need to update spu menus */ boolean_t b_spu_update; /* do we need to update spu menus */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management * input_ps.c: PS demux and packet management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.16 2001/04/20 05:40:03 stef Exp $ * $Id: input_ps.c,v 1.17 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr> * Cyril Deguet <asmax@via.ecp.fr>
...@@ -348,6 +348,7 @@ static void PSInit( input_thread_t * p_input ) ...@@ -348,6 +348,7 @@ static void PSInit( input_thread_t * p_input )
{ {
/* The programs will be added when we read them. */ /* The programs will be added when we read them. */
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_method = INPUT_METHOD_FILE;
p_input->stream.pp_programs[0]->b_is_ok = 0; p_input->stream.pp_programs[0]->b_is_ok = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.98 2001/04/15 04:19:58 sam Exp $ * $Id: input.c,v 1.99 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -225,6 +225,11 @@ static void RunThread( input_thread_t *p_input ) ...@@ -225,6 +225,11 @@ static void RunThread( input_thread_t *p_input )
return; return;
} }
/* initialization is completed */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_changed = 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
while( !p_input->b_die && !p_input->b_error && !p_input->b_eof ) while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
{ {
data_packet_t * pp_packets[p_input->i_read_once]; data_packet_t * pp_packets[p_input->i_read_once];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.49 2001/04/13 05:36:12 stef Exp $ * $Id: input_programs.c,v 1.50 2001/04/22 00:08:26 stef Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -57,7 +57,10 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len ) ...@@ -57,7 +57,10 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
p_input->stream.i_method = INPUT_METHOD_NONE; p_input->stream.i_method = INPUT_METHOD_NONE;
p_input->stream.i_stream_id = 0; p_input->stream.i_stream_id = 0;
p_input->stream.b_changed = 1;
/* initialized to 0 since we don't give the signal to the interface
* before the end of input initialization */
p_input->stream.b_changed = 0;
p_input->stream.pp_es = NULL; p_input->stream.pp_es = NULL;
p_input->stream.pp_selected_es = NULL; p_input->stream.pp_selected_es = NULL;
p_input->stream.pp_programs = NULL; p_input->stream.pp_programs = NULL;
...@@ -281,6 +284,8 @@ input_area_t * input_AddArea( input_thread_t * p_input ) ...@@ -281,6 +284,8 @@ input_area_t * input_AddArea( input_thread_t * p_input )
p_input->stream.pp_areas[i_area_index]->i_seek = NO_SEEK; p_input->stream.pp_areas[i_area_index]->i_seek = NO_SEEK;
p_input->stream.pp_areas[i_area_index]->i_part_nb = 1; p_input->stream.pp_areas[i_area_index]->i_part_nb = 1;
p_input->stream.pp_areas[i_area_index]->i_part= 0; p_input->stream.pp_areas[i_area_index]->i_part= 0;
p_input->stream.pp_areas[i_area_index]->i_angle_nb = 1;
p_input->stream.pp_areas[i_area_index]->i_angle = 0;
return p_input->stream.pp_areas[i_area_index]; return p_input->stream.pp_areas[i_area_index];
} }
......
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