Commit b465bcca authored by Stéphane Borel's avatar Stéphane Borel

-Updated the gtk/gnome interface to work in network mode,

-Fixed some bugs in interface (language menus in ts, misnamed fields)

-Play/Stop work in network mode to start/stop decoding of the stream

I have a segfault in imdct_3dn(93). But I can't underdand assembly.
parent 73620c74
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Declaration and extern access to global program object. * Declaration and extern access to global program object.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.19 2001/05/30 17:03:11 sam Exp $ * $Id: main.h,v 1.20 2001/05/30 23:02:03 stef Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -47,7 +47,6 @@ typedef struct main_s ...@@ -47,7 +47,6 @@ typedef struct main_s
/* Generic settings */ /* Generic settings */
boolean_t b_audio; /* is audio output allowed ? */ boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */ boolean_t b_video; /* is video output allowed ? */
boolean_t b_channels; /* is channel changing supported ? */
/* Unique threads */ /* Unique threads */
p_intf_thread_t p_intf; /* main interface thread */ p_intf_thread_t p_intf; /* main interface thread */
......
...@@ -53,6 +53,7 @@ typedef struct module_symbols_s ...@@ -53,6 +53,7 @@ typedef struct module_symbols_s
void ( * msleep ) ( mtime_t ); void ( * msleep ) ( mtime_t );
mtime_t ( * mdate ) ( void ); mtime_t ( * mdate ) ( void );
int ( * network_ChannelCreate )( void );
int ( * network_ChannelJoin ) ( int ); int ( * network_ChannelJoin ) ( int );
void ( * input_SetStatus ) ( struct input_thread_s *, int ); void ( * input_SetStatus ) ( struct input_thread_s *, int );
...@@ -94,6 +95,7 @@ typedef struct module_symbols_s ...@@ -94,6 +95,7 @@ typedef struct module_symbols_s
(p_symbols)->intf_UrlDecode = intf_UrlDecode; \ (p_symbols)->intf_UrlDecode = intf_UrlDecode; \
(p_symbols)->msleep = msleep; \ (p_symbols)->msleep = msleep; \
(p_symbols)->mdate = mdate; \ (p_symbols)->mdate = mdate; \
(p_symbols)->network_ChannelCreate = network_ChannelCreate; \
(p_symbols)->network_ChannelJoin = network_ChannelJoin; \ (p_symbols)->network_ChannelJoin = network_ChannelJoin; \
(p_symbols)->input_SetStatus = input_SetStatus; \ (p_symbols)->input_SetStatus = input_SetStatus; \
(p_symbols)->input_SetRate = input_SetRate; \ (p_symbols)->input_SetRate = input_SetRate; \
...@@ -138,6 +140,7 @@ extern module_symbols_t* p_symbols; ...@@ -138,6 +140,7 @@ extern module_symbols_t* p_symbols;
# define msleep(a) p_symbols->msleep(a) # define msleep(a) p_symbols->msleep(a)
# define mdate() p_symbols->mdate() # define mdate() p_symbols->mdate()
# define network_ChannelCreate() p_symbols->network_ChannelCreate()
# define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a) # define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
# define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b) # define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
......
...@@ -261,3 +261,4 @@ GnomePopupJumpActivate (GtkMenuItem *menuitem, ...@@ -261,3 +261,4 @@ GnomePopupJumpActivate (GtkMenuItem *menuitem,
} }
...@@ -133,3 +133,11 @@ GtkNetworkJoin (GtkEditable *editable, ...@@ -133,3 +133,11 @@ GtkNetworkJoin (GtkEditable *editable,
void void
GtkChannelGo (GtkButton *button, GtkChannelGo (GtkButton *button,
gpointer user_data); gpointer user_data);
void
GtkNetworkOpenBroadcast (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkNetworkOpenChannel (GtkToggleButton *togglebutton,
gpointer user_data);
...@@ -393,7 +393,6 @@ create_intf_window (void) ...@@ -393,7 +393,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop); gtk_widget_show (toolbar_stop);
gtk_widget_set_sensitive (toolbar_stop, FALSE);
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD);
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
...@@ -1388,11 +1387,19 @@ create_intf_network (void) ...@@ -1388,11 +1387,19 @@ create_intf_network (void)
GtkWidget *label18; GtkWidget *label18;
GtkObject *network_port_adj; GtkObject *network_port_adj;
GtkWidget *network_port; GtkWidget *network_port;
GtkWidget *broadcast_check; GtkWidget *network_broadcast_check;
GtkWidget *network_broadcast_combo; GtkWidget *network_broadcast_combo;
GtkWidget *network_broadcast; GtkWidget *network_broadcast;
GtkWidget *network_server_combo; GtkWidget *network_server_combo;
GtkWidget *network_server; GtkWidget *network_server;
GtkWidget *frame5;
GtkWidget *hbox4;
GtkWidget *network_channel_check;
GtkWidget *network_channel_combo;
GtkWidget *network_channel;
GtkWidget *channel_port;
GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port;
GtkWidget *hbuttonbox1; GtkWidget *hbuttonbox1;
GtkWidget *network_ok; GtkWidget *network_ok;
GtkWidget *network_cancel; GtkWidget *network_cancel;
...@@ -1493,7 +1500,7 @@ create_intf_network (void) ...@@ -1493,7 +1500,7 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5);
network_port_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10); network_port_adj = gtk_adjustment_new (1234, 1024, 65535, 1, 10, 10);
network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0); network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0);
gtk_widget_ref (network_port); gtk_widget_ref (network_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port", network_port, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port", network_port,
...@@ -1504,15 +1511,14 @@ create_intf_network (void) ...@@ -1504,15 +1511,14 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip (tooltips, network_port, _("Port of the stream server"), NULL); gtk_tooltips_set_tip (tooltips, network_port, _("Port of the stream server"), NULL);
broadcast_check = gtk_check_button_new_with_label (_("Broadcast")); network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (broadcast_check); gtk_widget_ref (network_broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "broadcast_check", broadcast_check, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_broadcast_check", network_broadcast_check,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (broadcast_check); gtk_widget_show (network_broadcast_check);
gtk_table_attach (GTK_TABLE (table2), broadcast_check, 0, 1, 2, 3, gtk_table_attach (GTK_TABLE (table2), network_broadcast_check, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (broadcast_check), TRUE);
network_broadcast_combo = gnome_entry_new (NULL); network_broadcast_combo = gnome_entry_new (NULL);
gtk_widget_ref (network_broadcast_combo); gtk_widget_ref (network_broadcast_combo);
...@@ -1547,6 +1553,60 @@ create_intf_network (void) ...@@ -1547,6 +1553,60 @@ create_intf_network (void)
gtk_widget_show (network_server); gtk_widget_show (network_server);
gtk_entry_set_text (GTK_ENTRY (network_server), _("vlsppc-02")); gtk_entry_set_text (GTK_ENTRY (network_server), _("vlsppc-02"));
frame5 = gtk_frame_new (_("Channels"));
gtk_widget_ref (frame5);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame5", frame5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame5);
gtk_box_pack_start (GTK_BOX (vbox5), frame5, TRUE, TRUE, 0);
gtk_frame_set_label_align (GTK_FRAME (frame5), 0.05, 0.5);
hbox4 = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (hbox4);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox4", hbox4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox4);
gtk_container_add (GTK_CONTAINER (frame5), hbox4);
network_channel_check = gtk_check_button_new_with_label (_("Channel server:"));
gtk_widget_ref (network_channel_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_check", network_channel_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_check);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_check, FALSE, FALSE, 0);
network_channel_combo = gnome_entry_new (NULL);
gtk_widget_ref (network_channel_combo);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_combo", network_channel_combo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_combo);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_combo, FALSE, FALSE, 0);
gtk_widget_set_sensitive (network_channel_combo, FALSE);
network_channel = gnome_entry_gtk_entry (GNOME_ENTRY (network_channel_combo));
gtk_widget_ref (network_channel);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel", network_channel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.220"));
channel_port = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port);
gtk_box_pack_start (GTK_BOX (hbox4), channel_port, FALSE, FALSE, 5);
network_channel_port_adj = gtk_adjustment_new (6010, 1024, 65535, 1, 10, 10);
network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
gtk_widget_ref (network_channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port", network_channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_port);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_port, FALSE, FALSE, 0);
gtk_widget_set_usize (network_channel_port, 60, -2);
gtk_widget_set_sensitive (network_channel_port, FALSE);
hbuttonbox1 = GNOME_DIALOG (intf_network)->action_area; hbuttonbox1 = GNOME_DIALOG (intf_network)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_network), "hbuttonbox1", hbuttonbox1); gtk_object_set_data (GTK_OBJECT (intf_network), "hbuttonbox1", hbuttonbox1);
gtk_widget_show (hbuttonbox1); gtk_widget_show (hbuttonbox1);
...@@ -1569,9 +1629,12 @@ create_intf_network (void) ...@@ -1569,9 +1629,12 @@ create_intf_network (void)
gtk_widget_show (network_cancel); gtk_widget_show (network_cancel);
GTK_WIDGET_SET_FLAGS (network_cancel, GTK_CAN_DEFAULT); GTK_WIDGET_SET_FLAGS (network_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (broadcast_check), "toggled", gtk_signal_connect (GTK_OBJECT (network_broadcast_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast), GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast),
NULL); "intf_network");
gtk_signal_connect (GTK_OBJECT (network_channel_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_ok), "clicked", gtk_signal_connect (GTK_OBJECT (network_ok), "clicked",
GTK_SIGNAL_FUNC (GtkNetworkOpenOk), GTK_SIGNAL_FUNC (GtkNetworkOpenOk),
"intf_network"); "intf_network");
...@@ -1806,7 +1869,7 @@ create_intf_playlist (void) ...@@ -1806,7 +1869,7 @@ create_intf_playlist (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (playlist_delete_menu_uiinfo[1].widget); gtk_widget_ref (playlist_delete_menu_uiinfo[1].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playmist_delete_item", gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_delete_item",
playlist_delete_menu_uiinfo[1].widget, playlist_delete_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.22 2001/05/30 17:03:12 sam Exp $ * $Id: gtk_callbacks.c,v 1.23 2001/05/30 23:02:03 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>
...@@ -282,7 +282,7 @@ void GtkNetworkJoin( GtkEditable * editable, gpointer user_data ) ...@@ -282,7 +282,7 @@ void GtkNetworkJoin( GtkEditable * editable, gpointer user_data )
int i_channel; int i_channel;
i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) ); i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) );
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel ); // intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
// network_ChannelJoin( i_channel ); // network_ChannelJoin( i_channel );
} }
...@@ -293,6 +293,8 @@ void GtkChannelGo( GtkButton * button, gpointer user_data ) ...@@ -293,6 +293,8 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
GtkWidget * spin; GtkWidget * spin;
int i_channel; int i_channel;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
window = gtk_widget_get_toplevel( GTK_WIDGET (button) ); window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ), spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
"network_channel_spinbutton" ) ); "network_channel_spinbutton" ) );
...@@ -300,7 +302,29 @@ void GtkChannelGo( GtkButton * button, gpointer user_data ) ...@@ -300,7 +302,29 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) ); i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) );
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel ); intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
vlc_mutex_lock( &p_intf->change_lock );
if( p_intf->p_input != NULL )
{
/* end playing item */
p_intf->p_input->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf );
}
vlc_mutex_unlock( &p_intf->change_lock );
network_ChannelJoin( i_channel ); network_ChannelJoin( i_channel );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.h : Callbacks for the gtk plugin. * gtk_callbacks.h : Callbacks for the gtk plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.14 2001/05/30 05:19:03 stef Exp $ * $Id: gtk_callbacks.h,v 1.15 2001/05/30 23:02:03 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>
...@@ -68,3 +68,5 @@ void GtkJumpActivate ( GtkMenuItem *, gpointer ); ...@@ -68,3 +68,5 @@ void GtkJumpActivate ( GtkMenuItem *, gpointer );
void GtkNetworkJoin ( GtkEditable *, gpointer ); void GtkNetworkJoin ( GtkEditable *, gpointer );
void GtkChannelGo ( GtkButton *, gpointer ); void GtkChannelGo ( GtkButton *, gpointer );
void GtkNetworkOpenChannel ( GtkToggleButton *, gpointer );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_display.c: Gtk+ tools for main interface * gtk_display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.c,v 1.3 2001/05/30 17:03:12 sam Exp $ * $Id: gtk_display.c,v 1.4 2001/05/30 23:02:03 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>
...@@ -101,6 +101,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -101,6 +101,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
GtkWidget * p_network_box; GtkWidget * p_network_box;
GtkWidget * p_slider; GtkWidget * p_slider;
GtkWidget * p_label; GtkWidget * p_label;
GtkWidget * p_channel;
boolean_t b_control; boolean_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \ #define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
...@@ -152,6 +153,18 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -152,6 +153,18 @@ gint GtkModeManage( intf_thread_t * p_intf )
"network_address_label" ); "network_address_label" );
gtk_label_set_text( GTK_LABEL( p_label ), gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source ); p_intf->p_input->p_source );
p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_channel_box" ) );
if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) )
{
gtk_widget_show( GTK_WIDGET( p_channel ) );
}
else
{
gtk_widget_hide( GTK_WIDGET( p_channel ) );
}
break; break;
default: default:
intf_ErrMsg( "intf error: can't determine input method" ); intf_ErrMsg( "intf error: can't determine input method" );
...@@ -206,12 +219,10 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -206,12 +219,10 @@ gint GtkModeManage( intf_thread_t * p_intf )
/* set control items */ /* set control items */
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE ); gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE ); gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control ); gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
......
...@@ -89,7 +89,7 @@ create_intf_window (void) ...@@ -89,7 +89,7 @@ create_intf_window (void)
GtkWidget *chapter_prev_button; GtkWidget *chapter_prev_button;
GtkWidget *chapter_next_button; GtkWidget *chapter_next_button;
GtkWidget *network_box; GtkWidget *network_box;
GtkWidget *network_address; GtkWidget *network_address_label;
GtkWidget *network_channel_box; GtkWidget *network_channel_box;
GtkWidget *channel_label; GtkWidget *channel_label;
GtkObject *network_channel_spinbutton_adj; GtkObject *network_channel_spinbutton_adj;
...@@ -503,7 +503,6 @@ create_intf_window (void) ...@@ -503,7 +503,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop); gtk_widget_show (toolbar_stop);
gtk_widget_set_sensitive (toolbar_stop, FALSE);
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON, GTK_TOOLBAR_CHILD_BUTTON,
...@@ -721,12 +720,12 @@ create_intf_window (void) ...@@ -721,12 +720,12 @@ create_intf_window (void)
gtk_box_pack_start (GTK_BOX (window_vbox), network_box, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (window_vbox), network_box, TRUE, TRUE, 0);
gtk_widget_set_usize (network_box, 500, 24); gtk_widget_set_usize (network_box, 500, 24);
network_address = gtk_label_new (_("No server !")); network_address_label = gtk_label_new (_("No server !"));
gtk_widget_ref (network_address); gtk_widget_ref (network_address_label);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_address", network_address, gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_address_label", network_address_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_address); gtk_widget_show (network_address_label);
gtk_box_pack_start (GTK_BOX (network_box), network_address, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (network_box), network_address_label, TRUE, TRUE, 0);
network_channel_box = gtk_hbox_new (FALSE, 0); network_channel_box = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (network_channel_box); gtk_widget_ref (network_channel_box);
...@@ -938,7 +937,6 @@ create_intf_popup (void) ...@@ -938,7 +937,6 @@ create_intf_popup (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_stop); gtk_widget_show (popup_stop);
gtk_container_add (GTK_CONTAINER (intf_popup), popup_stop); gtk_container_add (GTK_CONTAINER (intf_popup), popup_stop);
gtk_widget_set_sensitive (popup_stop, FALSE);
popup_back = gtk_menu_item_new_with_label (_("Back")); popup_back = gtk_menu_item_new_with_label (_("Back"));
gtk_widget_ref (popup_back); gtk_widget_ref (popup_back);
...@@ -1599,12 +1597,20 @@ create_intf_network (void) ...@@ -1599,12 +1597,20 @@ create_intf_network (void)
GtkWidget *network_port; GtkWidget *network_port;
GtkWidget *label24; GtkWidget *label24;
GtkWidget *label25; GtkWidget *label25;
GtkWidget *broadcast_check; GtkWidget *network_broadcast_check;
GtkWidget *network_broadcast_combo; GtkWidget *network_broadcast_combo;
GtkWidget *network_broadcast; GtkWidget *network_broadcast;
GtkWidget *network_server_combo; GtkWidget *network_server_combo;
GList *network_server_combo_items = NULL; GList *network_server_combo_items = NULL;
GtkWidget *network_server; GtkWidget *network_server;
GtkWidget *frame6;
GtkWidget *hbox14;
GtkWidget *network_channel_check;
GtkWidget *network_channel_combo;
GtkWidget *network_channel;
GtkWidget *channel_port;
GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port;
GtkWidget *hbox4; GtkWidget *hbox4;
GtkWidget *hbox5; GtkWidget *hbox5;
GtkWidget *network_ok; GtkWidget *network_ok;
...@@ -1723,12 +1729,12 @@ create_intf_network (void) ...@@ -1723,12 +1729,12 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5);
broadcast_check = gtk_check_button_new_with_label (_("Broadcast")); network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (broadcast_check); gtk_widget_ref (network_broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "broadcast_check", broadcast_check, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_broadcast_check", network_broadcast_check,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (broadcast_check); gtk_widget_show (network_broadcast_check);
gtk_table_attach (GTK_TABLE (table2), broadcast_check, 0, 1, 2, 3, gtk_table_attach (GTK_TABLE (table2), network_broadcast_check, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
...@@ -1748,6 +1754,7 @@ create_intf_network (void) ...@@ -1748,6 +1754,7 @@ create_intf_network (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_broadcast); gtk_widget_show (network_broadcast);
gtk_widget_set_sensitive (network_broadcast, FALSE); gtk_widget_set_sensitive (network_broadcast, FALSE);
gtk_entry_set_text (GTK_ENTRY (network_broadcast), _("138.195.143.255"));
network_server_combo = gtk_combo_new (); network_server_combo = gtk_combo_new ();
gtk_widget_ref (network_server_combo); gtk_widget_ref (network_server_combo);
...@@ -1766,7 +1773,59 @@ create_intf_network (void) ...@@ -1766,7 +1773,59 @@ create_intf_network (void)
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server", network_server, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server", network_server,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_server); gtk_widget_show (network_server);
gtk_entry_set_text (GTK_ENTRY (network_server), _("vls")); gtk_entry_set_text (GTK_ENTRY (network_server), _("vlsppc-02"));
frame6 = gtk_frame_new (_("Channels"));
gtk_widget_ref (frame6);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame6", frame6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame6);
gtk_box_pack_start (GTK_BOX (vbox8), frame6, TRUE, TRUE, 5);
gtk_frame_set_label_align (GTK_FRAME (frame6), 0.05, 0.5);
hbox14 = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (hbox14);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox14", hbox14,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox14);
gtk_container_add (GTK_CONTAINER (frame6), hbox14);
network_channel_check = gtk_check_button_new_with_label (_("Channel server:"));
gtk_widget_ref (network_channel_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_check", network_channel_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_check);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_check, FALSE, FALSE, 0);
network_channel_combo = gtk_combo_new ();
gtk_widget_ref (network_channel_combo);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_combo", network_channel_combo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_combo);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_combo, TRUE, TRUE, 0);
network_channel = GTK_COMBO (network_channel_combo)->entry;
gtk_widget_ref (network_channel);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel", network_channel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.220"));
channel_port = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port);
gtk_box_pack_start (GTK_BOX (hbox14), channel_port, FALSE, FALSE, 5);
network_channel_port_adj = gtk_adjustment_new (6010, 1024, 100, 1, 10, 10);
network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
gtk_widget_ref (network_channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port", network_channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_port);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_port, TRUE, TRUE, 0);
gtk_widget_set_usize (network_channel_port, 62, -2);
hbox4 = GTK_DIALOG (intf_network)->action_area; hbox4 = GTK_DIALOG (intf_network)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_network), "hbox4", hbox4); gtk_object_set_data (GTK_OBJECT (intf_network), "hbox4", hbox4);
...@@ -1794,9 +1853,12 @@ create_intf_network (void) ...@@ -1794,9 +1853,12 @@ create_intf_network (void)
gtk_widget_show (network_cancel); gtk_widget_show (network_cancel);
gtk_box_pack_start (GTK_BOX (hbox5), network_cancel, FALSE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox5), network_cancel, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (broadcast_check), "toggled", gtk_signal_connect (GTK_OBJECT (network_broadcast_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast), GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast),
"intf_network"); "intf_network");
gtk_signal_connect (GTK_OBJECT (network_channel_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_ok), "clicked", gtk_signal_connect (GTK_OBJECT (network_ok), "clicked",
GTK_SIGNAL_FUNC (GtkNetworkOpenOk), GTK_SIGNAL_FUNC (GtkNetworkOpenOk),
"intf_network"); "intf_network");
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items. * gtk_menu.c : functions to handle menu items.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.6 2001/05/30 17:03:12 sam Exp $ * $Id: gtk_menu.c,v 1.7 2001/05/30 23:02:04 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>
...@@ -791,7 +791,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf ) ...@@ -791,7 +791,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
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;
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock ); // vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
if( p_intf->p_sys->b_title_update ) if( p_intf->p_sys->b_title_update )
{ {
...@@ -923,6 +923,8 @@ gint GtkSetupMenus( intf_thread_t * p_intf ) ...@@ -923,6 +923,8 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
p_intf->p_sys->b_spu_update = 0; p_intf->p_sys->b_spu_update = 0;
} }
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
return TRUE; return TRUE;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets. * gtk_open.c : functions to handle file/disc/network open widgets.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.4 2001/05/30 17:03:12 sam Exp $ * $Id: gtk_open.c,v 1.5 2001/05/30 23:02:04 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>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "intf_gtk.h" #include "intf_gtk.h"
#include "main.h" #include "main.h"
#include "netutils.h"
#include "modules_export.h" #include "modules_export.h"
...@@ -275,6 +276,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -275,6 +276,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
char * psz_source, *psz_server, *psz_protocol; char * psz_source, *psz_server, *psz_protocol;
unsigned int i_port; unsigned int i_port;
boolean_t b_broadcast; boolean_t b_broadcast;
boolean_t b_channel;
int i_end = p_main->p_playlist->i_size; int i_end = p_main->p_playlist->i_size;
gtk_widget_hide( p_intf->p_sys->p_network ); gtk_widget_hide( p_intf->p_sys->p_network );
...@@ -308,7 +310,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -308,7 +310,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
/* do we have a broadcast address */ /* do we have a broadcast address */
b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "broadcast_check" ) ) ); lookup_widget( GTK_WIDGET(button), "network_broadcast_check" ) ) );
if( b_broadcast ) if( b_broadcast )
{ {
char * psz_broadcast; char * psz_broadcast;
...@@ -346,6 +348,32 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -346,6 +348,32 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port ); sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port );
} }
/* Manage channel server */
b_channel = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_check" ) ) );
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, b_channel );
if( b_channel )
{
char * psz_channel;
unsigned int i_channel_port;
if( p_main->p_channel == NULL )
{
network_ChannelCreate();
}
psz_channel = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_channel" ) ) );
i_channel_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_port" ) ) );
main_PutPszVariable( INPUT_CHANNEL_SERVER_VAR, psz_channel );
if( i_channel_port < 65536 )
{
main_PutIntVariable( INPUT_CHANNEL_PORT_VAR, i_channel_port );
}
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source ); free( psz_source );
...@@ -387,6 +415,27 @@ void GtkNetworkOpenBroadcast( GtkToggleButton * togglebutton, ...@@ -387,6 +415,27 @@ void GtkNetworkOpenBroadcast( GtkToggleButton * togglebutton,
} }
void GtkNetworkOpenChannel( GtkToggleButton * togglebutton,
gpointer user_data )
{
GtkWidget * p_network;
p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_combo" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_port" ),
gtk_toggle_button_get_active( togglebutton ) );
}
/**************************************************************************** /****************************************************************************
* Callbacks for menuitem * Callbacks for menuitem
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_open.h: prototypes for open functions * gtk_open.h: prototypes for open functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_open.h,v 1.2 2001/05/15 14:49:48 stef Exp $ * $Id: gtk_open.h,v 1.3 2001/05/30 23:02:04 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>
...@@ -36,6 +36,7 @@ gboolean GtkNetworkOpenShow ( GtkWidget *, GdkEventButton *, gpointer ); ...@@ -36,6 +36,7 @@ gboolean GtkNetworkOpenShow ( GtkWidget *, GdkEventButton *, gpointer );
void GtkNetworkOpenOk ( GtkButton *, gpointer ); void GtkNetworkOpenOk ( GtkButton *, gpointer );
void GtkNetworkOpenCancel ( GtkButton *, gpointer ); void GtkNetworkOpenCancel ( GtkButton *, gpointer );
void GtkNetworkOpenBroadcast( GtkToggleButton *, gpointer ); void GtkNetworkOpenBroadcast( GtkToggleButton *, gpointer );
void GtkNetworkOpenChannel ( GtkToggleButton *, gpointer );
void GtkFileOpenActivate ( GtkMenuItem *, gpointer ); void GtkFileOpenActivate ( GtkMenuItem *, gpointer );
void GtkDiscOpenActivate ( GtkMenuItem *, gpointer ); void GtkDiscOpenActivate ( GtkMenuItem *, gpointer );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog * gtk_playlist.c : Interface for the playlist dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: gtk_playlist.c,v 1.15 2001/05/30 17:03:12 sam Exp $ * $Id: gtk_playlist.c,v 1.16 2001/05/30 23:02:04 stef Exp $
* *
* Authors: Pierre Baillet <oct@zoy.org> * Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -198,7 +198,7 @@ void GtkPlaylistDeleteSelected( GtkMenuItem * menuitem, gpointer user_data ) ...@@ -198,7 +198,7 @@ void GtkPlaylistDeleteSelected( GtkMenuItem * menuitem, gpointer user_data )
playlist_t *p_playlist; playlist_t *p_playlist;
/* catch the thread back */ /* catch the thread back */
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), (char*)user_data ); intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), /*(char*)user_data*/"intf_playlist" );
p_playlist = p_main->p_playlist; p_playlist = p_main->p_playlist;
......
...@@ -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.2 2001/05/30 17:03:12 sam Exp $ * $Id: intf_gnome.c,v 1.3 2001/05/30 23:02:04 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>
...@@ -323,6 +323,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -323,6 +323,7 @@ static gint GnomeManage( gpointer p_data )
if( p_intf->p_input->stream.b_changed ) if( p_intf->p_input->stream.b_changed )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
GtkSetupMenus( p_intf );
} }
/* Manage the slider */ /* Manage the slider */
...@@ -358,7 +359,6 @@ static gint GnomeManage( gpointer p_data ) ...@@ -358,7 +359,6 @@ static gint GnomeManage( gpointer p_data )
} }
#undef p_area #undef p_area
} }
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
if( p_intf->p_sys->i_part != if( 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 )
...@@ -367,6 +367,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -367,6 +367,7 @@ static gint GnomeManage( gpointer p_data )
GtkSetupMenus( p_intf ); GtkSetupMenus( p_intf );
} }
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
} }
else if( !p_intf->b_die ) else if( !p_intf->b_die )
{ {
......
...@@ -423,7 +423,6 @@ ...@@ -423,7 +423,6 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_stop</name> <name>toolbar_stop</name>
<sensitive>False</sensitive>
<tooltip>Stop Stream</tooltip> <tooltip>Stop Stream</tooltip>
<signal> <signal>
<name>button_press_event</name> <name>button_press_event</name>
...@@ -2018,7 +2017,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -2018,7 +2017,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<snap>False</snap> <snap>False</snap>
<wrap>False</wrap> <wrap>False</wrap>
<value>1234</value> <value>1234</value>
<lower>0</lower> <lower>1024</lower>
<upper>65535</upper> <upper>65535</upper>
<step>1</step> <step>1</step>
<page>10</page> <page>10</page>
...@@ -2041,15 +2040,16 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -2041,15 +2040,16 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget> <widget>
<class>GtkCheckButton</class> <class>GtkCheckButton</class>
<name>broadcast_check</name> <name>network_broadcast_check</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
<name>toggled</name> <name>toggled</name>
<handler>GtkNetworkOpenBroadcast</handler> <handler>GtkNetworkOpenBroadcast</handler>
<last_modification_time>Sat, 19 May 2001 02:57:46 GMT</last_modification_time> <data>&quot;intf_network&quot;</data>
<last_modification_time>Wed, 30 May 2001 13:30:02 GMT</last_modification_time>
</signal> </signal>
<label>Broadcast</label> <label>Broadcast</label>
<active>True</active> <active>False</active>
<draw_indicator>True</draw_indicator> <draw_indicator>True</draw_indicator>
<child> <child>
<left_attach>0</left_attach> <left_attach>0</left_attach>
...@@ -2132,6 +2132,111 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -2132,6 +2132,111 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkFrame</class>
<name>frame5</name>
<label>Channels</label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHBox</class>
<name>hbox4</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkCheckButton</class>
<name>network_channel_check</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>GtkNetworkOpenChannel</handler>
<data>&quot;intf_network&quot;</data>
<last_modification_time>Wed, 30 May 2001 13:30:25 GMT</last_modification_time>
</signal>
<label>Channel server:</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GnomeEntry</class>
<name>network_channel_combo</name>
<sensitive>False</sensitive>
<max_saved>10</max_saved>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GnomeEntry:entry</child_name>
<name>network_channel</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>138.195.143.220</text>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<name>channel_port</name>
<label>port:</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>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkSpinButton</class>
<name>network_channel_port</name>
<width>60</width>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<climb_rate>1</climb_rate>
<digits>0</digits>
<numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap>
<wrap>False</wrap>
<value>6010</value>
<lower>1024</lower>
<upper>65535</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
...@@ -2403,7 +2508,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -2403,7 +2508,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>playmist_delete_item</name> <name>playlist_delete_item</name>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkPlaylistDeleteSelected</handler> <handler>GtkPlaylistDeleteSelected</handler>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface * intf_gtk.c: Gtk+ interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.22 2001/05/30 17:03:12 sam Exp $ * $Id: intf_gtk.c,v 1.23 2001/05/30 23:02:04 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>
...@@ -323,6 +323,7 @@ static gint GtkManage( gpointer p_data ) ...@@ -323,6 +323,7 @@ static gint GtkManage( gpointer p_data )
if( p_intf->p_input->stream.b_changed ) if( p_intf->p_input->stream.b_changed )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
GtkSetupMenus( p_intf );
} }
/* Manage the slider */ /* Manage the slider */
...@@ -358,7 +359,6 @@ static gint GtkManage( gpointer p_data ) ...@@ -358,7 +359,6 @@ static gint GtkManage( gpointer p_data )
} }
#undef p_area #undef p_area
} }
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
if( p_intf->p_sys->i_part != if( 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 )
...@@ -367,6 +367,8 @@ static gint GtkManage( gpointer p_data ) ...@@ -367,6 +367,8 @@ static gint GtkManage( gpointer p_data )
GtkSetupMenus( p_intf ); GtkSetupMenus( p_intf );
} }
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
} }
else if( !p_intf->b_die ) else if( !p_intf->b_die )
{ {
......
...@@ -431,7 +431,6 @@ ...@@ -431,7 +431,6 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_stop</name> <name>toolbar_stop</name>
<sensitive>False</sensitive>
<tooltip>Stop Stream</tooltip> <tooltip>Stop Stream</tooltip>
<signal> <signal>
<name>button_press_event</name> <name>button_press_event</name>
...@@ -849,7 +848,7 @@ ...@@ -849,7 +848,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>network_address</name> <name>network_address_label</name>
<label>No server !</label> <label>No server !</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -989,7 +988,6 @@ ...@@ -989,7 +988,6 @@
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>popup_stop</name> <name>popup_stop</name>
<sensitive>False</sensitive>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtKStopActivate</handler> <handler>GtKStopActivate</handler>
...@@ -2120,7 +2118,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2120,7 +2118,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<widget> <widget>
<class>GtkCheckButton</class> <class>GtkCheckButton</class>
<name>broadcast_check</name> <name>network_broadcast_check</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
<name>toggled</name> <name>toggled</name>
...@@ -2181,7 +2179,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2181,7 +2179,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>
<text></text> <text>138.195.143.255</text>
</widget> </widget>
</widget> </widget>
...@@ -2218,9 +2216,117 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2218,9 +2216,117 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<editable>True</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>
<text>vls</text> <text>vlsppc-02</text>
</widget>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkFrame</class>
<name>frame6</name>
<label>Channels</label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>5</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHBox</class>
<name>hbox14</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkCheckButton</class>
<name>network_channel_check</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>GtkNetworkOpenChannel</handler>
<data>&quot;intf_network&quot;</data>
<last_modification_time>Wed, 30 May 2001 16:57:53 GMT</last_modification_time>
</signal>
<label>Channel server:</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>network_channel_combo</name>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>network_channel</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>138.195.143.220</text>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<name>channel_port</name>
<label>port:</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>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkSpinButton</class>
<name>network_channel_port</name>
<width>62</width>
<can_focus>True</can_focus>
<climb_rate>1</climb_rate>
<digits>0</digits>
<numeric>False</numeric>
<update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap>
<wrap>False</wrap>
<value>6010</value>
<lower>1024</lower>
<upper>100</upper>
<step>1</step>
<page>10</page>
<page_size>10</page_size>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget> </widget>
</widget> </widget>
</widget> </widget>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_imdct_3dn.c: accelerated 3D Now! ac3 DCT * ac3_imdct_3dn.c: accelerated 3D Now! ac3 DCT
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_imdct_3dn.c,v 1.2 2001/05/28 02:38:48 sam Exp $ * $Id: ac3_imdct_3dn.c,v 1.3 2001/05/30 23:02:04 stef Exp $
* *
* Authors: Renaud Dartus <reno@videolan.org> * Authors: Renaud Dartus <reno@videolan.org>
* *
...@@ -59,7 +59,7 @@ void _M( imdct_init ) (imdct_t * p_imdct) ...@@ -59,7 +59,7 @@ void _M( imdct_init ) (imdct_t * p_imdct)
int i; int i;
float scale = 181.019; float scale = 181.019;
fprintf(stderr,"imct_init\n"); intf_WarnMsg( 6, "imct_init" );
for (i=0; i < 128; i++) for (i=0; i < 128; i++)
{ {
float xcos_i = cos(2.0f * M_PI * (8*i+1)/(8*N)) * scale; float xcos_i = cos(2.0f * M_PI * (8*i+1)/(8*N)) * scale;
...@@ -69,7 +69,7 @@ void _M( imdct_init ) (imdct_t * p_imdct) ...@@ -69,7 +69,7 @@ void _M( imdct_init ) (imdct_t * p_imdct)
p_imdct->xcos_sin_sse[i * 4 + 2] = -xsin_i; p_imdct->xcos_sin_sse[i * 4 + 2] = -xsin_i;
p_imdct->xcos_sin_sse[i * 4 + 3] = -xcos_i; p_imdct->xcos_sin_sse[i * 4 + 3] = -xcos_i;
} }
fprintf(stderr,"done imct_init\n"); intf_WarnMsg( 6, "done imct_init" );
} }
void _M( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[]) void _M( imdct_do_512 ) (imdct_t * p_imdct, float data[], float delay[])
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_spdif: ac3 passthrough output * aout_spdif: ac3 passthrough output
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.7 2001/05/30 05:19:03 stef Exp $ * $Id: aout_spdif.c,v 1.8 2001/05/30 23:02:04 stef Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "aout_common.h" #include "aout_common.h"
#define BLANK_FRAME_MAX 100 #define BLANK_FRAME_MAX 100
#define SLEEP_TIME 16000
/***************************************************************************** /*****************************************************************************
* aout_SpdifThread: audio output thread that sends raw spdif data * aout_SpdifThread: audio output thread that sends raw spdif data
...@@ -63,7 +64,6 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -63,7 +64,6 @@ void aout_SpdifThread( aout_thread_t * p_aout )
mtime_t mplay; mtime_t mplay;
mtime_t mdelta; mtime_t mdelta;
mtime_t mlast = 0; mtime_t mlast = 0;
mtime_t m_frame_time;
/* get a blank frame ready */ /* get a blank frame ready */
memset( pi_blank, 0, sizeof(pi_blank) ); memset( pi_blank, 0, sizeof(pi_blank) );
...@@ -76,7 +76,6 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -76,7 +76,6 @@ void aout_SpdifThread( aout_thread_t * p_aout )
i_blank = 0; i_blank = 0;
/* Compute the theorical duration of an ac3 frame */ /* Compute the theorical duration of an ac3 frame */
m_frame_time = 1000000 * AC3_FRAME_SIZE / p_aout->fifo[0].l_rate;
while( !p_aout->b_die ) while( !p_aout->b_die )
{ {
...@@ -105,7 +104,7 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -105,7 +104,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
l_start_frame]; l_start_frame];
mdelta = mplay - mdate(); mdelta = mplay - mdate();
if( mdelta < ( 2 * m_frame_time ) ) if( mdelta < ( 2 * SLEEP_TIME ) )
{ {
intf_WarnMsg( 12, "spdif out (%d):" intf_WarnMsg( 12, "spdif out (%d):"
"playing frame %lld (%lld)", "playing frame %lld (%lld)",
...@@ -140,7 +139,7 @@ void aout_SpdifThread( aout_thread_t * p_aout ) ...@@ -140,7 +139,7 @@ void aout_SpdifThread( aout_thread_t * p_aout )
{ {
/* we leave some time for aout fifo to fill and not to stress /* we leave some time for aout fifo to fill and not to stress
* the external decoder too much */ * the external decoder too much */
msleep( m_frame_time / 2 ); msleep( SLEEP_TIME );
} }
else else
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.97 2001/05/30 05:19:03 stef Exp $ * $Id: main.c,v 1.98 2001/05/30 23:02:04 stef Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -176,10 +176,10 @@ static const struct option longopts[] = ...@@ -176,10 +176,10 @@ static const struct option longopts[] =
/* Input options */ /* Input options */
{ "input", 1, 0, OPT_INPUT }, { "input", 1, 0, OPT_INPUT },
{ "channels", 0, 0, OPT_CHANNELS },
{ "server", 1, 0, OPT_SERVER }, { "server", 1, 0, OPT_SERVER },
{ "port", 1, 0, OPT_PORT }, { "port", 1, 0, OPT_PORT },
{ "broadcast", 1, 0, OPT_BROADCAST }, { "broadcast", 1, 0, OPT_BROADCAST },
{ "channels", 0, 0, OPT_CHANNELS },
/* Synchro options */ /* Synchro options */
{ "synchro", 1, 0, OPT_SYNCHRO }, { "synchro", 1, 0, OPT_SYNCHRO },
...@@ -305,12 +305,14 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -305,12 +305,14 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/* /*
* Initialize shared resources and libraries * Initialize shared resources and libraries
*/ */
if( p_main->b_channels && network_ChannelCreate() ) if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) &&
network_ChannelCreate() )
{ {
/* On error during Channels initialization, switch off channels */ /* On error during Channels initialization, switch off channels */
intf_Msg( "Channels initialization failed : " intf_Msg( "Channels initialization failed : "
"Channel management is deactivated" ); "Channel management is deactivated" );
p_main->b_channels = 0; main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, 0 );
} }
/* /*
...@@ -341,7 +343,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -341,7 +343,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/* /*
* Go back into channel 0 which is the network * Go back into channel 0 which is the network
*/ */
if( p_main->b_channels ) if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) )
{ {
network_ChannelJoin( COMMON_CHANNEL ); network_ChannelJoin( COMMON_CHANNEL );
} }
...@@ -480,10 +483,11 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -480,10 +483,11 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
p_main->b_audio = 1; p_main->b_audio = 1;
p_main->b_video = 1; p_main->b_video = 1;
p_main->b_channels = 0;
p_main->i_warning_level = 0; p_main->i_warning_level = 0;
p_main->p_channel = NULL;
/* Get the executable name (similar to the basename command) */ /* Get the executable name (similar to the basename command) */
p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ]; p_main->psz_arg0 = p_tmp = ppsz_argv[ 0 ];
while( *p_tmp ) while( *p_tmp )
...@@ -644,7 +648,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -644,7 +648,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutPszVariable( INPUT_METHOD_VAR, optarg ); main_PutPszVariable( INPUT_METHOD_VAR, optarg );
break; break;
case OPT_CHANNELS: /* --channels */ case OPT_CHANNELS: /* --channels */
p_main->b_channels = 1;
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, 1 ); main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, 1 );
break; break;
case OPT_SERVER: /* --server */ case OPT_SERVER: /* --server */
...@@ -810,7 +813,7 @@ static void Usage( int i_fashion ) ...@@ -810,7 +813,7 @@ static void Usage( int i_fashion )
"\n " INPUT_SERVER_VAR "=<hostname> \tvideo server" "\n " INPUT_SERVER_VAR "=<hostname> \tvideo server"
"\n " INPUT_PORT_VAR "=<port> \tvideo server port" "\n " INPUT_PORT_VAR "=<port> \tvideo server port"
"\n " INPUT_IFACE_VAR "=<interface> \tnetwork interface" "\n " INPUT_IFACE_VAR "=<interface> \tnetwork interface"
"\n " INPUT_BROADCAST_VAR "=<addr> \tbroadcast mode" "\n " INPUT_BCAST_ADDR_VAR "=<addr> \tbroadcast mode"
"\n " INPUT_CHANNEL_SERVER_VAR "=<hostname> \tchannel server" "\n " INPUT_CHANNEL_SERVER_VAR "=<hostname> \tchannel server"
"\n " INPUT_CHANNEL_PORT_VAR "=<port> \tchannel server port" ); "\n " INPUT_CHANNEL_PORT_VAR "=<port> \tchannel server port" );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* netutils.c: various network functions * netutils.c: various network functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.c,v 1.34 2001/05/30 17:03:12 sam Exp $ * $Id: netutils.c,v 1.35 2001/05/30 23:02:04 stef Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -256,8 +256,10 @@ int network_ChannelJoin( int i_channel ) ...@@ -256,8 +256,10 @@ int network_ChannelJoin( int i_channel )
char i_answer; char i_answer;
fd_set fd; fd_set fd;
unsigned int i_rc; unsigned int i_rc;
char * psz_channel_server;
if( ! p_main->b_channels ) if( !main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) )
{ {
intf_ErrMsg( "network: channels disabled, to enable them, use the" intf_ErrMsg( "network: channels disabled, to enable them, use the"
"--channels option" ); "--channels option" );
...@@ -269,14 +271,14 @@ int network_ChannelJoin( int i_channel ) ...@@ -269,14 +271,14 @@ int network_ChannelJoin( int i_channel )
/* If last change is too recent, wait a while */ /* If last change is too recent, wait a while */
if( mdate() - p_main->p_channel->last_change < INPUT_CHANNEL_CHANGE_DELAY ) if( mdate() - p_main->p_channel->last_change < INPUT_CHANNEL_CHANGE_DELAY )
{ {
intf_Msg( "network: waiting before changing channel" ); intf_WarnMsg( 2, "network: waiting before changing channel" );
mwait( p_main->p_channel->last_change + INPUT_CHANNEL_CHANGE_DELAY ); mwait( p_main->p_channel->last_change + INPUT_CHANNEL_CHANGE_DELAY );
} }
p_main->p_channel->last_change = mdate(); p_main->p_channel->last_change = mdate();
p_main->p_channel->i_channel = i_channel; p_main->p_channel->i_channel = i_channel;
intf_Msg( "network: joining channel %d", i_channel ); intf_WarnMsg( 2, "network: joining channel %d", i_channel );
/* /*
* Initializing the socket * Initializing the socket
...@@ -286,14 +288,25 @@ int network_ChannelJoin( int i_channel ) ...@@ -286,14 +288,25 @@ int network_ChannelJoin( int i_channel )
/* /*
* Getting the server's information * Getting the server's information
*/ */
intf_WarnMsg( 6, "Channel server: %s port: %d",
main_GetPszVariable( INPUT_CHANNEL_SERVER_VAR,
INPUT_CHANNEL_SERVER_DEFAULT ),
main_GetIntVariable( INPUT_CHANNEL_PORT_VAR,
INPUT_CHANNEL_PORT_DEFAULT ) );
memset( &sa_server, 0x00, sizeof(struct sockaddr_in) ); memset( &sa_server, 0x00, sizeof(struct sockaddr_in) );
sa_server.sin_family = AF_INET; sa_server.sin_family = AF_INET;
sa_server.sin_port = htons( INPUT_CHANNEL_PORT_DEFAULT ); sa_server.sin_port = htons( main_GetIntVariable( INPUT_CHANNEL_PORT_VAR,
INPUT_CHANNEL_PORT_DEFAULT ) );
psz_channel_server = strdup( main_GetPszVariable( INPUT_CHANNEL_SERVER_VAR,
INPUT_CHANNEL_SERVER_DEFAULT ) );
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
inet_aton( INPUT_CHANNEL_SERVER_DEFAULT, &sa_server.sin_addr ); inet_aton( psz_channel_server, &sa_server.sin_addr );
#else #else
sa_server.sin_addr.s_addr = inet_addr( INPUT_CHANNEL_SERVER_DEFAULT ); sa_server.sin_addr.s_addr = inet_addr( psz_channel_server );
#endif #endif
free( psz_channel_server );
/* /*
* Looking for the interface MAC address * Looking for the interface MAC address
......
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