*fixed a lock issue in the interface introduced in my last commit
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.65 2001/05/31 03:57:54 sam Exp $
+ * $Id: input_dvd.c,v 1.66 2001/05/31 16:10:05 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
+/* how many blocks DVDRead will read in each loop */
+#define DVD_BLOCK_READ_ONCE 32
+#define DVD_DATA_READ_ONCE 4*DVD_BLOCK_READ_ONCE
+
+/* Size of netlist */
+#define DVD_NETLIST_SIZE 2048
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
/*****************************************************************************
* Local prototypes
*****************************************************************************/
p_dvd->i_fd = p_input->i_handle;
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 = 32;
- p_input->i_read_once = 128;
+ /* We read DVD_BLOCK_READ_ONCE in each loop, so the input will receive
+ * DVD_DATA_READ_ONCE at most */
+ p_dvd->i_block_once = DVD_BLOCK_READ_ONCE;
+ /* this value mustn't be modifed */
+ p_input->i_read_once = DVD_DATA_READ_ONCE;
i = CSSTest( p_input->i_handle );
i = CSSTest( p_input->i_handle );
/* Reading structures initialisation */
p_input->p_method_data =
/* Reading structures initialisation */
p_input->p_method_data =
- DVDNetlistInit( 2048, 4096, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
+ DVDNetlistInit( DVD_NETLIST_SIZE, 2*DVD_NETLIST_SIZE,
+ DVD_NETLIST_SIZE, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo allocation & initialisation */
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo allocation & initialisation */
thread_dvd_data_t * p_dvd;
dvd_netlist_t * p_netlist;
struct iovec * p_vec;
thread_dvd_data_t * p_dvd;
dvd_netlist_t * p_netlist;
struct iovec * p_vec;
- struct data_packet_s ** pp_data;
+ struct data_packet_s * pp_data[DVD_DATA_READ_ONCE];
u8 * pi_cur;
int i_block_once;
int i_packet_size;
u8 * pi_cur;
int i_block_once;
int i_packet_size;
boolean_t b_eof;
boolean_t b_eot;
boolean_t b_eof;
boolean_t b_eot;
- pp_data = (struct data_packet_s **) malloc( p_input->i_read_once *
- sizeof( struct data_packet_s * ) );
- if( pp_data == NULL )
- {
- intf_ErrMsg( "dvd error: out of memory" );
- return -1;
- }
-
- pp_data = (struct data_packet_s **) malloc( p_input->i_read_once *
- sizeof( struct data_packet_s * ) );
- if( pp_data == NULL )
- {
- intf_ErrMsg( "dvd error: out of memory" );
- return -1;
- }
-
p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL )
{
intf_ErrMsg( "dvd error: can't get iovec" );
if( ( p_vec = DVDGetiovec( p_netlist ) ) == NULL )
{
intf_ErrMsg( "dvd error: can't get iovec" );
{
pp_packets[0] = NULL;
intf_ErrMsg( "dvd error: can't find next cell" );
{
pp_packets[0] = NULL;
intf_ErrMsg( "dvd error: can't find next cell" );
else
{
intf_ErrMsg( "Unable to determine stream type" );
else
{
intf_ErrMsg( "Unable to determine stream type" );
vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_mutex_unlock( &p_input->stream.stream_lock );
- free( pp_data );
-
- free( pp_data );
-
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.23 2001/05/30 23:02:03 stef Exp $
+ * $Id: gtk_callbacks.c,v 1.24 2001/05/31 16:10:05 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_menu.c,v 1.7 2001/05/30 23:02:04 stef Exp $
+ * $Id: gtk_menu.c,v 1.8 2001/05/31 16:10:05 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_chapter_update = 1;
input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_chapter_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
p_intf->p_input->stream.pp_areas[i_title] );
p_intf->p_sys->b_title_update = 1;
p_intf->p_input->stream.pp_areas[i_title] );
p_intf->p_sys->b_title_update = 1;
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
p_intf->p_sys->b_title_update = 0;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 0;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.10 2001/05/31 03:12:49 sam Exp $
+ * $Id: aout_spdif.c,v 1.11 2001/05/31 16:10:05 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include "audio_output.h"
#include "aout_common.h"
#include "audio_output.h"
#include "aout_common.h"
-#define BLANK_FRAME_MAX 100
+#define BLANK_FRAME_MAX 1000
#define SLEEP_TIME 16000
/*****************************************************************************
#define SLEEP_TIME 16000
/*****************************************************************************