Commit 0fee43a4 authored by Stéphane Borel's avatar Stéphane Borel

-Fall back to one-packet-once reading in dvd input since multi-block

seems to have a bug that make the vlc crash on title/audio/spu change. I
hope that this bug will be fixed soon for the performance is poorer now

-add-ons and changes in gnome interface:
        *menu subdivision is done only if there are over 20 items,
        *in DVD mode next/prev apply to title,
        *in DVD mode, added a box with button to navigate through
         chapters.
This has not been finished yet (and it is not in gtk plugin then). And I
think I will leave toolbar next/prev buttons for playlist and add
button specifically for title change like for chapters.*
parent 8ccd224c
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.36 2001/04/02 23:30:41 sam Exp $
* $Id: input_dvd.c,v 1.37 2001/04/03 03:39:41 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -691,7 +691,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
i_spu += vts.manager_inf.i_audio_nb;
input_SelectES( p_input, p_input->stream.pp_es[i_spu] );
}
} // i_title >= 0
} /* i_title >= 0 */
else
{
p_area = p_input->stream.p_selected_area;
......@@ -747,8 +747,11 @@ static void DVDInit( input_thread_t * p_input )
p_dvd->i_fd = p_input->i_handle;
p_dvd->i_block_once = 32;
p_input->i_read_once = 128;
/* 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 = 4;//128;
i = CSSTest( p_input->i_handle );
......@@ -766,7 +769,7 @@ static void DVDInit( input_thread_t * p_input )
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 8192, 16384, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
DVDNetlistInit( 2048, 8192, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo initialisation */
......
......@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.19 2001/04/01 07:31:38 stef Exp $
* $Id: gnome_callbacks.c,v 1.20 2001/04/03 03:39:41 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -160,6 +160,44 @@ on_intf_window_drag_data_received (GtkWidget *widget,
}
void
on_button_chapter_prev_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf;
input_area_t * p_area;
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
p_area = p_intf->p_input->stream.p_selected_area;
if( p_area->i_part - 1 >= 0 )
{
p_area->i_part--;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
void
on_button_chapter_next_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf;
input_area_t * p_area;
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
p_area = p_intf->p_input->stream.p_selected_area;
if( p_area->i_part + 1 < p_area->i_part_nb )
{
p_area->i_part++;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
/*****************************************************************************
* Menubar callbacks
*****************************************************************************
......@@ -505,6 +543,48 @@ on_toolbar_next_clicked (GtkButton *button,
}
void
on_toolbar_prev_title_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf;
input_area_t * p_area;
int i_id;
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
if( i_id >= 0 )
{
p_area = p_intf->p_input->stream.pp_areas[i_id];
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_menus_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
void
on_toolbar_next_title_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf;
input_area_t * p_area;
int i_id;
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_intf->p_input->stream.i_area_nb )
{
p_area = p_intf->p_input->stream.pp_areas[i_id];
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
p_intf->p_sys->b_menus_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
/*****************************************************************************
* Popup callbacks
*****************************************************************************
......@@ -856,6 +936,8 @@ on_disc_ok_clicked (GtkButton *button,
"disc_dvd" ) )->active )
{
psz_method = "dvd";
p_intf->p_sys->i_intf_mode = DVD_MODE;
p_intf->p_sys->b_mode_changed = 1;
}
else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_vcd" ) )->active )
......
......@@ -2,7 +2,7 @@
* gnome_callbacks.h : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.h,v 1.12 2001/03/21 13:42:34 sam Exp $
* $Id: gnome_callbacks.h,v 1.13 2001/04/03 03:39:41 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -86,6 +86,14 @@ void
on_toolbar_next_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_prev_title_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_next_title_clicked (GtkButton *button,
gpointer user_data);
void
on_popup_play_activate (GtkMenuItem *menuitem,
gpointer user_data);
......@@ -273,3 +281,11 @@ on_slider_button_release_event (GtkWidget *widget,
void
on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_button_chapter_prev_clicked (GtkButton *button,
gpointer user_data);
void
on_button_chapter_next_clicked (GtkButton *button,
gpointer user_data);
......@@ -140,7 +140,16 @@ create_intf_window (void)
GtkWidget *label_status;
GtkWidget *label_bar;
GtkWidget *slider;
GtkWidget *dvd_box;
GtkWidget *label_title;
GtkWidget *hbox6;
GtkWidget *button_chapter_prev;
GtkWidget *label_chapter;
GtkWidget *button_chapter_next;
GtkWidget *appbar;
GtkTooltips *tooltips;
tooltips = gtk_tooltips_new ();
intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client"));
gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window);
......@@ -462,6 +471,51 @@ create_intf_window (void)
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_scale_set_digits (GTK_SCALE (slider), 3);
dvd_box = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (dvd_box);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "dvd_box", dvd_box,
(GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (vbox2), dvd_box, TRUE, TRUE, 0);
label_title = gtk_label_new (_("Title:"));
gtk_widget_ref (label_title);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_title", label_title,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_title);
gtk_box_pack_start (GTK_BOX (dvd_box), label_title, TRUE, FALSE, 0);
hbox6 = gtk_hbox_new (FALSE, 10);
gtk_widget_ref (hbox6);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "hbox6", hbox6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox6);
gtk_box_pack_start (GTK_BOX (dvd_box), hbox6, TRUE, FALSE, 0);
button_chapter_prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
gtk_widget_ref (button_chapter_prev);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_chapter_prev", button_chapter_prev,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_chapter_prev);
gtk_box_pack_start (GTK_BOX (hbox6), button_chapter_prev, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_prev, _("Select previous chapter"), NULL);
gtk_button_set_relief (GTK_BUTTON (button_chapter_prev), GTK_RELIEF_NONE);
label_chapter = gtk_label_new (_("Chapter: "));
gtk_widget_ref (label_chapter);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_chapter", label_chapter,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_chapter);
gtk_box_pack_start (GTK_BOX (hbox6), label_chapter, FALSE, FALSE, 0);
button_chapter_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
gtk_widget_ref (button_chapter_next);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_chapter_next", button_chapter_next,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_chapter_next);
gtk_box_pack_start (GTK_BOX (hbox6), button_chapter_next, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL);
gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE);
appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "appbar", appbar,
......@@ -518,6 +572,14 @@ create_intf_window (void)
gtk_signal_connect (GTK_OBJECT (slider), "button_release_event",
GTK_SIGNAL_FUNC (on_slider_button_release_event),
NULL);
gtk_signal_connect (GTK_OBJECT (button_chapter_prev), "clicked",
GTK_SIGNAL_FUNC (on_button_chapter_prev_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (button_chapter_next), "clicked",
GTK_SIGNAL_FUNC (on_button_chapter_next_clicked),
NULL);
gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips);
return intf_window;
}
......
This diff is collapsed.
......@@ -581,6 +581,103 @@
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>dvd_box</name>
<visible>False</visible>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label_title</name>
<label>Title:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox6</name>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button_chapter_prev</name>
<tooltip>Select previous chapter</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_button_chapter_prev_clicked</handler>
<last_modification_time>Tue, 03 Apr 2001 00:53:47 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
<relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label_chapter</name>
<label>Chapter: </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button_chapter_next</name>
<tooltip>Select next chapter</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_button_chapter_next_clicked</handler>
<last_modification_time>Tue, 03 Apr 2001 00:53:40 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
<relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
</widget>
......
......@@ -2,7 +2,7 @@
* intf_gnome.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.h,v 1.4 2001/04/01 07:31:38 stef Exp $
* $Id: intf_gnome.h,v 1.5 2001/04/03 03:39:41 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -27,6 +27,14 @@
#define DROP_ACCEPT_TEXT_URI_LIST 0
#define DROP_ACCEPT_TEXT_PLAIN 1
/*****************************************************************************
* interface modes
*****************************************************************************/
#define FILE_MODE 0
#define NET_MODE 1
#define DVD_MODE 2
#define VCD_MODE 3
/*****************************************************************************
* intf_sys_t: description and status of Gnome interface
*****************************************************************************/
......@@ -57,6 +65,12 @@ typedef struct intf_sys_s
/* The window labels */
GtkLabel * p_label_date;
GtkLabel * p_label_status;
GtkLabel * p_label_title;
GtkLabel * p_label_chapter;
/* input mode management */
boolean_t b_mode_changed;
gint i_intf_mode; /* interface mode: file, net, disc */
/* XXX: Ugly kludge, see intf_gnome.c */
void ( *pf_gtk_callback ) ( void );
......
......@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_dec.c,v 1.8 2001/02/08 13:52:35 massiot Exp $
* $Id: input_dec.c,v 1.9 2001/04/03 03:39:41 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -70,7 +70,11 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
}
/* Waiting for the thread to exit */
/* I thought that unlocking was better since thread join can be long
* but it actually creates late pictures and freezes --stef */
// vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_thread_join( p_es->thread_id );
// vlc_mutex_lock( &p_input->stream.stream_lock );
/* Freeing all packets still in the decoder fifo. */
while( !DECODER_FIFO_ISEMPTY( *p_es->p_decoder_fifo ) )
......@@ -111,7 +115,7 @@ void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * p_pes )
/* The FIFO is full !!! This should not happen. */
p_decoder_fifo->pf_delete_pes( p_decoder_fifo->p_packets_mgt,
p_pes );
intf_ErrMsg( "PES trashed - fifo full !" );
intf_ErrMsg( "PES trashed - decoder fifo full !" );
}
vlc_mutex_unlock( &p_decoder_fifo->data_lock );
}
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.42 2001/04/01 07:31:38 stef Exp $
* $Id: input_programs.c,v 1.43 2001/04/03 03:39:41 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -730,7 +730,6 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
if( p_input->stream.pp_selected_es == NULL )
{
intf_ErrMsg( "No more selected ES in input_UnselectES" );
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( 1 );
}
}
......
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