Commit 043b5c89 authored by Sam Hocevar's avatar Sam Hocevar

  * Automatic handling of the Channel Server's response in network mode.
parent b70a26fa
.* .*
core core
core.*
.dep .dep
gmon.out gmon.out
vlc-debug.log vlc-debug.log
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* modules. * modules.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.h,v 1.15 2001/10/22 12:28:53 massiot Exp $ * $Id: netutils.h,v 1.16 2001/11/12 04:12:37 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org> * Henri Fallon <henri@videolan.org>
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
struct sockaddr_in; struct sockaddr_in;
int network_BuildLocalAddr ( struct sockaddr_in *, int, char * ); int network_BuildLocalAddr ( struct sockaddr_in *, int, char * );
int network_BuildRemoteAddr( struct sockaddr_in *, char * ); int network_BuildRemoteAddr ( struct sockaddr_in *, char * );
int network_ChannelJoin ( int ); int network_ChannelJoin ( int );
int network_ChannelCreate ( void ); int network_ChannelCreate ( void );
...@@ -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.24 2001/05/31 16:10:05 stef Exp $ * $Id: gtk_callbacks.c,v 1.25 2001/11/12 04:12:37 sam 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>
...@@ -326,12 +326,16 @@ void GtkChannelGo( GtkButton * button, gpointer user_data ) ...@@ -326,12 +326,16 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
/* FIXME: ugly hack to close input and outputs */ /* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf ); 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 );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
} }
......
...@@ -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.152 2001/11/09 13:49:26 massiot Exp $ * $Id: input.c,v 1.153 2001/11/12 04:12:37 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -534,7 +534,6 @@ static void EndThread( input_thread_t * p_input ) ...@@ -534,7 +534,6 @@ static void EndThread( input_thread_t * p_input )
/* Release modules */ /* Release modules */
module_Unneed( p_input->p_input_module ); module_Unneed( p_input->p_input_module );
} }
/***************************************************************************** /*****************************************************************************
...@@ -812,6 +811,11 @@ static void NetworkOpen( input_thread_t * p_input ) ...@@ -812,6 +811,11 @@ static void NetworkOpen( input_thread_t * p_input )
psz_server = NULL; psz_server = NULL;
} }
} }
else
{
/* This is required or NetworkClose will never be called */
p_input->p_source = "ts: network input";
}
/* Check that we got a valid server */ /* Check that we got a valid server */
if( psz_server == NULL ) if( psz_server == NULL )
...@@ -986,6 +990,8 @@ static void NetworkOpen( input_thread_t * p_input ) ...@@ -986,6 +990,8 @@ static void NetworkOpen( input_thread_t * p_input )
*****************************************************************************/ *****************************************************************************/
static void NetworkClose( input_thread_t * p_input ) static void NetworkClose( input_thread_t * p_input )
{ {
intf_WarnMsg( 2, "input: closing network target `%s'", p_input->p_source );
close( p_input->i_handle ); close( p_input->i_handle );
#ifdef WIN32 #ifdef WIN32
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_playlist.c : Playlist management functions * intf_playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_playlist.c,v 1.8 2001/08/09 08:20:26 sam Exp $ * $Id: intf_playlist.c,v 1.9 2001/11/12 04:12:38 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -164,7 +164,7 @@ void intf_PlaylistNext( playlist_t * p_playlist ) ...@@ -164,7 +164,7 @@ void intf_PlaylistNext( playlist_t * p_playlist )
void intf_PlaylistPrev( playlist_t * p_playlist ) void intf_PlaylistPrev( playlist_t * p_playlist )
{ {
vlc_mutex_lock( &p_playlist->change_lock ); vlc_mutex_lock( &p_playlist->change_lock );
p_playlist->i_mode = -p_playlist->i_mode; p_playlist->i_mode = -p_playlist->i_mode;
NextItem( p_playlist ); NextItem( p_playlist );
p_playlist->i_mode = -p_playlist->i_mode; p_playlist->i_mode = -p_playlist->i_mode;
...@@ -202,15 +202,15 @@ int intf_PlaylistDelete( playlist_t * p_playlist, int i_pos ) ...@@ -202,15 +202,15 @@ int intf_PlaylistDelete( playlist_t * p_playlist, int i_pos )
if( i_pos < p_playlist->i_index ) if( i_pos < p_playlist->i_index )
p_playlist->i_index--; p_playlist->i_index--;
/* Decrement playlist size */ /* Decrement playlist size */
p_playlist->i_size--; p_playlist->i_size--;
p_playlist->p_item = realloc( p_playlist->p_item, p_playlist->p_item = realloc( p_playlist->p_item,
p_playlist->i_size * sizeof( playlist_item_t ) ); p_playlist->i_size * sizeof( playlist_item_t ) );
intf_WarnMsg( 3, "intf: removed `%s' from playlist", psz_name ); intf_WarnMsg( 3, "intf: removed `%s' from playlist", psz_name );
/* Delete the item */ /* Delete the item */
free( psz_name ); free( psz_name );
...@@ -252,9 +252,9 @@ void intf_PlaylistDestroy( playlist_t * p_playlist ) ...@@ -252,9 +252,9 @@ void intf_PlaylistDestroy( playlist_t * p_playlist )
void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos) void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
{ {
vlc_mutex_lock( &p_playlist->change_lock ); vlc_mutex_lock( &p_playlist->change_lock );
p_playlist->i_index = i_pos; p_playlist->i_index = i_pos;
if( p_playlist->i_index != -1 ) if( p_playlist->i_index != -1 )
{ {
if( p_playlist->current.psz_name != NULL ) if( p_playlist->current.psz_name != NULL )
...@@ -270,7 +270,7 @@ void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos) ...@@ -270,7 +270,7 @@ void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
p_main->p_playlist->b_stopped = 0; p_main->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_playlist->change_lock ); vlc_mutex_unlock( &p_playlist->change_lock );
} }
/* URL-decode a file: URL path, return NULL if it's not what we expect */ /* URL-decode a file: URL path, return NULL if it's not what we expect */
void intf_UrlDecode( char *encoded_path ) void intf_UrlDecode( char *encoded_path )
...@@ -282,11 +282,11 @@ void intf_UrlDecode( char *encoded_path ) ...@@ -282,11 +282,11 @@ void intf_UrlDecode( char *encoded_path )
{ {
return; return;
} }
cur = encoded_path ; cur = encoded_path ;
tmp = calloc(strlen(encoded_path) + 1, sizeof(char) ); tmp = calloc(strlen(encoded_path) + 1, sizeof(char) );
while ( ( ext = strchr(cur, '%') ) != NULL) while ( ( ext = strchr(cur, '%') ) != NULL)
{ {
strncat(tmp, cur, (ext - cur) / sizeof(char)); strncat(tmp, cur, (ext - cur) / sizeof(char));
...@@ -299,7 +299,7 @@ void intf_UrlDecode( char *encoded_path ) ...@@ -299,7 +299,7 @@ void intf_UrlDecode( char *encoded_path )
} }
tmp[strlen(tmp)] = (char)realchar; tmp[strlen(tmp)] = (char)realchar;
cur = ext + 2; cur = ext + 2;
} }
......
This diff is collapsed.
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