Commit 881768ad authored by Laurent Aimar's avatar Laurent Aimar

* all: begin to add mms over udp support. It begin to work (at least

for me) but it still needs some work.
parent 1158db5f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* buffer.c: MMS access plug-in * buffer.c: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: buffer.c,v 1.1 2002/11/22 18:35:57 sam Exp $ * $Id: buffer.c,v 1.2 2002/11/25 00:22:04 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -193,7 +193,7 @@ uint64_t var_buffer_get64( var_buffer_t *p_buf ) ...@@ -193,7 +193,7 @@ uint64_t var_buffer_get64( var_buffer_t *p_buf )
return( i_dw1 + ( i_dw2 << 32 ) ); return( i_dw1 + ( i_dw2 << 32 ) );
} }
int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int i_mem ) int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem )
{ {
int i_copy; int i_copy;
...@@ -202,6 +202,11 @@ int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int i_mem ) ...@@ -202,6 +202,11 @@ int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int i_mem )
{ {
memcpy( p_mem, p_buf + p_buf->i_data, i_copy ); memcpy( p_mem, p_buf + p_buf->i_data, i_copy );
} }
if( i_copy < 0 )
{
// fprintf( stderr, "\n**************arrrrrrggggg\n" );
i_copy = 0;
}
p_buf->i_data += i_copy; p_buf->i_data += i_copy;
return( i_copy ); return( i_copy );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* buffer.h: MMS access plug-in * buffer.h: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: buffer.h,v 1.1 2002/11/22 18:35:57 sam Exp $ * $Id: buffer.h,v 1.2 2002/11/25 00:22:04 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -50,7 +50,7 @@ uint8_t var_buffer_get8 ( var_buffer_t *p_buf ); ...@@ -50,7 +50,7 @@ uint8_t var_buffer_get8 ( var_buffer_t *p_buf );
uint16_t var_buffer_get16( var_buffer_t *p_buf ); uint16_t var_buffer_get16( var_buffer_t *p_buf );
uint32_t var_buffer_get32( var_buffer_t *p_buf ); uint32_t var_buffer_get32( var_buffer_t *p_buf );
uint64_t var_buffer_get64( var_buffer_t *p_buf ); uint64_t var_buffer_get64( var_buffer_t *p_buf );
int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int i_mem ); int var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem );
int var_buffer_readempty( var_buffer_t *p_buf ); int var_buffer_readempty( var_buffer_t *p_buf );
void var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid ); void var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in * mms.c: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.c,v 1.6 2002/11/22 18:35:57 sam Exp $ * $Id: mms.c,v 1.7 2002/11/25 00:22:04 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -76,8 +76,6 @@ static void Close ( vlc_object_t * ); ...@@ -76,8 +76,6 @@ static void Close ( vlc_object_t * );
static int Read ( input_thread_t * p_input, byte_t * p_buffer, static int Read ( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len ); size_t i_len );
static ssize_t NetRead ( input_thread_t * p_input, input_socket_t * p_socket,
byte_t * p_buffer, size_t i_len );
static void Seek ( input_thread_t *, off_t ); static void Seek ( input_thread_t *, off_t );
static int SetProgram ( input_thread_t *, pgrm_descriptor_t * ); static int SetProgram ( input_thread_t *, pgrm_descriptor_t * );
...@@ -85,7 +83,7 @@ static int SetProgram ( input_thread_t *, pgrm_descriptor_t * ); ...@@ -85,7 +83,7 @@ static int SetProgram ( input_thread_t *, pgrm_descriptor_t * );
static int MMSOpen( input_thread_t *, url_t *, int, char * ); static int MMSOpen( input_thread_t *, url_t *, int, char * );
static int MMSStart ( input_thread_t *, uint32_t ); static int MMSStart ( input_thread_t *, uint32_t );
static int MMSStop ( input_thread_t *p_input ); // Not used static int MMSStop ( input_thread_t *p_input );
static int MMSClose ( input_thread_t * ); static int MMSClose ( input_thread_t * );
...@@ -109,7 +107,9 @@ static void mms_ParseURL( url_t *p_url, char *psz_url ); ...@@ -109,7 +107,9 @@ static void mms_ParseURL( url_t *p_url, char *psz_url );
/* /*
* Ok, ok, j'le ferai plus... * Ok, ok, j'le ferai plus...
*/ */
/*
* Merci :))
*/
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -122,8 +122,6 @@ vlc_module_begin(); ...@@ -122,8 +122,6 @@ vlc_module_begin();
"force selection of all streams", "force selection of all streams",
"force selection of all streams" ); "force selection of all streams" );
// add_bool( "mms-modem", 0, NULL, "Set maxbitrate to 56Kb/s","" );
add_string( "mms-stream", NULL, NULL, add_string( "mms-stream", NULL, NULL,
"streams selection", "streams selection",
"force this stream selection" ); "force this stream selection" );
...@@ -152,8 +150,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -152,8 +150,6 @@ static int Open( vlc_object_t *p_this )
(void*)p_access = malloc( sizeof( access_t ) ); (void*)p_access = malloc( sizeof( access_t ) );
memset( p_access, 0, sizeof( access_t ) ); memset( p_access, 0, sizeof( access_t ) );
p_access->p_cmd = malloc( BUF_SIZE );
/* *** Parse URL and get server addr/port and path *** */ /* *** Parse URL and get server addr/port and path *** */
mms_ParseURL( &p_access->url, p_input->psz_name ); mms_ParseURL( &p_access->url, p_input->psz_name );
...@@ -161,15 +157,18 @@ static int Open( vlc_object_t *p_this ) ...@@ -161,15 +157,18 @@ static int Open( vlc_object_t *p_this )
!( *p_access->url.psz_server_addr ) ) !( *p_access->url.psz_server_addr ) )
{ {
FREE( p_access->url.psz_private ); FREE( p_access->url.psz_private );
FREE( p_access->p_cmd );
msg_Err( p_input, "invalid server name" ); msg_Err( p_input, "invalid server name" );
return( -1 ); return( -1 );
} }
if( p_access->url.i_server_port == 0 ) if( p_access->url.i_server_port == 0 )
{ {
p_access->url.i_server_port = 1755; // default port p_access->url.i_server_port = 1755; /* default port */
} }
if( p_access->url.i_bind_port == 0 )
{
p_access->url.i_bind_port = 7000; /* default port */
}
/* *** connect to this server *** */ /* *** connect to this server *** */
/* 1: look at requested protocol (udp/tcp) */ /* 1: look at requested protocol (udp/tcp) */
...@@ -197,11 +196,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -197,11 +196,11 @@ static int Open( vlc_object_t *p_this )
} }
/* 3: connect */ /* 3: connect */
if( i_proto == MMS_PROTO_AUTO ) if( i_proto == MMS_PROTO_AUTO )
{ // first try with TCP { /* first try with TCP */
i_status = i_status =
MMSOpen( p_input, &p_access->url, MMS_PROTO_TCP, psz_network ); MMSOpen( p_input, &p_access->url, MMS_PROTO_TCP, psz_network );
if( i_status < 0 ) if( i_status < 0 )
{ // then with UDP { /* then with UDP */
i_status = i_status =
MMSOpen( p_input, &p_access->url, MMS_PROTO_UDP, psz_network ); MMSOpen( p_input, &p_access->url, MMS_PROTO_UDP, psz_network );
} }
...@@ -215,16 +214,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -215,16 +214,12 @@ static int Open( vlc_object_t *p_this )
if( i_status < 0 ) if( i_status < 0 )
{ {
// all sockets are closed
msg_Err( p_input, "cannot connect to server" ); msg_Err( p_input, "cannot connect to server" );
FREE( p_access->url.psz_private ); FREE( p_access->url.psz_private );
FREE( p_access->p_cmd );
return( -1 ); return( -1 );
} }
msg_Dbg( p_input, "connected to %s", p_access->url.psz_server_addr ); msg_Dbg( p_input, "connected to %s", p_access->url.psz_server_addr );
// all sockets are open
/* *** set exported functions *** */ /* *** set exported functions *** */
p_input->pf_read = Read; p_input->pf_read = Read;
...@@ -232,7 +227,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -232,7 +227,7 @@ static int Open( vlc_object_t *p_this )
p_input->pf_set_program = SetProgram; p_input->pf_set_program = SetProgram;
p_input->pf_set_area = NULL; p_input->pf_set_area = NULL;
p_input->p_private = NULL; // XXX ?? p_input->p_private = NULL;
/* *** finished to set some variable *** */ /* *** finished to set some variable *** */
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
...@@ -261,7 +256,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -261,7 +256,6 @@ static int Open( vlc_object_t *p_this )
msg_Err( p_input, "cannot start stream" ); msg_Err( p_input, "cannot start stream" );
MMSClose( p_input ); MMSClose( p_input );
FREE( p_access->url.psz_private ); FREE( p_access->url.psz_private );
FREE( p_access->p_cmd );
return( -1 ); return( -1 );
} }
...@@ -281,7 +275,6 @@ static void Close( vlc_object_t *p_this ) ...@@ -281,7 +275,6 @@ static void Close( vlc_object_t *p_this )
/* free memory */ /* free memory */
FREE( p_access->url.psz_private ); FREE( p_access->url.psz_private );
FREE( p_access->p_cmd );
} }
/***************************************************************************** /*****************************************************************************
...@@ -404,60 +397,6 @@ static int Read ( input_thread_t * p_input, byte_t * p_buffer, ...@@ -404,60 +397,6 @@ static int Read ( input_thread_t * p_input, byte_t * p_buffer,
return( i_data ); return( i_data );
} }
/*****************************************************************************
* NetRead: read on a file descriptor, checking b_die periodically
*****************************************************************************/
static ssize_t NetRead( input_thread_t * p_input, input_socket_t * p_socket,
byte_t * p_buffer, size_t i_len )
{
#ifdef UNDER_CE
return -1;
#else
struct timeval timeout;
fd_set fds;
int i_ret;
/* Initialize file descriptor set */
FD_ZERO( &fds );
FD_SET( p_socket->i_handle, &fds );
/* We'll wait 0.5 second if nothing happens */
timeout.tv_sec = 0;
timeout.tv_usec = 500000;
/* Find if some data is available */
i_ret = select( p_socket->i_handle + 1, &fds,
NULL, NULL, &timeout );
if( i_ret == -1 && errno != EINTR )
{
msg_Err( p_input, "network select error (%s)", strerror(errno) );
}
else if( i_ret > 0 )
{
ssize_t i_recv = recv( p_socket->i_handle, p_buffer, i_len, 0 );
if( i_recv > 0 )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell += i_recv;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
if( i_recv < 0 )
{
msg_Err( p_input, "recv failed (%s)", strerror(errno) );
}
return i_recv;
}
return 0;
#endif
}
static void asf_HeaderParse( mms_stream_t stream[128], static void asf_HeaderParse( mms_stream_t stream[128],
uint8_t *p_header, int i_header ) uint8_t *p_header, int i_header )
{ {
...@@ -471,17 +410,21 @@ static void asf_HeaderParse( mms_stream_t stream[128], ...@@ -471,17 +410,21 @@ static void asf_HeaderParse( mms_stream_t stream[128],
stream[i].i_cat = MMS_STREAM_UNKNOWN; stream[i].i_cat = MMS_STREAM_UNKNOWN;
} }
// fprintf( stderr, " ---------------------header:%d\n", i_header );
var_buffer_initread( &buffer, p_header, i_header ); var_buffer_initread( &buffer, p_header, i_header );
var_buffer_getguid( &buffer, &guid ); var_buffer_getguid( &buffer, &guid );
if( !CmpGuid( &guid, &asf_object_header_guid ) ) if( !CmpGuid( &guid, &asf_object_header_guid ) )
{ {
// XXX Error // XXX Error
// fprintf( stderr, " ---------------------ERROR------\n" );
} }
var_buffer_getmemory( &buffer, NULL, 30 - 16 ); var_buffer_getmemory( &buffer, NULL, 30 - 16 );
for( ;; ) for( ;; )
{ {
// fprintf( stderr, " ---------------------data:%d\n", buffer.i_data );
if( var_buffer_readempty( &buffer ) ) if( var_buffer_readempty( &buffer ) )
{ {
return; return;
...@@ -493,13 +436,14 @@ static void asf_HeaderParse( mms_stream_t stream[128], ...@@ -493,13 +436,14 @@ static void asf_HeaderParse( mms_stream_t stream[128],
{ {
int i_stream_id; int i_stream_id;
guid_t stream_type; guid_t stream_type;
// msg_Dbg( p_input, "found stream_properties" ); // msg_Dbg( p_input, "found stream_properties" );
var_buffer_getguid( &buffer, &stream_type ); var_buffer_getguid( &buffer, &stream_type );
var_buffer_getmemory( &buffer, NULL, 32 ); var_buffer_getmemory( &buffer, NULL, 32 );
i_stream_id = var_buffer_get8( &buffer ) & 0x7f; i_stream_id = var_buffer_get8( &buffer ) & 0x7f;
var_buffer_getmemory( &buffer, NULL, i_size - 24 - 32 - 16 - 1 );
// fprintf( stderr, " 1---------------------skip:%lld\n", i_size - 24 - 32 - 16 - 1 );
var_buffer_getmemory( &buffer, NULL, i_size - 24 - 32 - 16 - 1);
if( CmpGuid( &stream_type, &asf_object_stream_type_video ) ) if( CmpGuid( &stream_type, &asf_object_stream_type_video ) )
{ {
...@@ -531,12 +475,14 @@ static void asf_HeaderParse( mms_stream_t stream[128], ...@@ -531,12 +475,14 @@ static void asf_HeaderParse( mms_stream_t stream[128],
i_count--; i_count--;
i_size -= 6; i_size -= 6;
} }
// fprintf( stderr, " 2---------------------skip:%lld\n", i_size - 24);
var_buffer_getmemory( &buffer, NULL, i_size - 24 ); var_buffer_getmemory( &buffer, NULL, i_size - 24 );
} }
else else
{ {
// skip unknown guid // skip unknown guid
var_buffer_getmemory( &buffer, NULL, i_size - 24 ); var_buffer_getmemory( &buffer, NULL, i_size - 24 );
// fprintf( stderr, " 3---------------------skip:%lld\n", i_size - 24);
} }
} }
} }
...@@ -731,40 +677,64 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -731,40 +677,64 @@ static int MMSOpen( input_thread_t *p_input,
p_input->p_private = (void*)&socket_desc; p_input->p_private = (void*)&socket_desc;
if( !( p_network = module_Need( p_input, "network", psz_network ) ) ) if( !( p_network = module_Need( p_input, "network", psz_network ) ) )
{ {
msg_Err( p_input, "failed to open a connection" ); msg_Err( p_input, "failed to open a connection (tcp)" );
return( -1 ); return( -1 );
} }
module_Unneed( p_input, p_network ); module_Unneed( p_input, p_network );
p_access->socket_server.i_handle = socket_desc.i_handle; p_access->socket_tcp.i_handle = socket_desc.i_handle;
p_input->i_mtu = socket_desc.i_mtu; // FIXME p_input->i_mtu = 0; /*socket_desc.i_mtu;*/
msg_Dbg( p_input, msg_Dbg( p_input,
"connection with \"%s:%d\" successful", "connection(tcp) with \"%s:%d\" successful",
p_url->psz_server_addr, p_url->psz_server_addr,
p_url->i_server_port ); p_url->i_server_port );
/* *** Bind port if UDP protocol is selected *** */ /* *** Bind port if UDP protocol is selected *** */
// TODO
if( b_udp ) if( b_udp )
{ {
msg_Err( p_input, msg_Err( p_input,
"MMS/UDP not yet implemented" ); "MMS/UDP not yet functionnal, anyway trying..." );
// close socket if( !p_url->psz_bind_addr || !*p_url->psz_bind_addr )
{
msg_Err( p_input, "for udp you have to provide bind address (mms://<server_addr>@<bind_addr/<path> (FIXME)" );
#if defined( UNDER_CE ) #if defined( UNDER_CE )
CloseHandle( (HANDLE)p_access->socket_server.i_handle ); CloseHandle( (HANDLE)p_access->socket_tcp.i_handle );
#elif defined( WIN32 ) #elif defined( WIN32 )
closesocket( p_access->socket_server.i_handle ); closesocket( p_access->socket_tcp.i_handle );
#else #else
close( p_access->socket_server.i_handle ); close( p_access->socket_tcp.i_handle );
#endif #endif
return( -1 ); return( -1 );
}
socket_desc.i_type = NETWORK_UDP;
socket_desc.psz_server_addr = "";
socket_desc.i_server_port = 0;
socket_desc.psz_bind_addr = p_url->psz_bind_addr;
socket_desc.i_bind_port = p_url->i_bind_port;
p_input->p_private = (void*)&socket_desc;
if( !( p_network = module_Need( p_input, "network", psz_network ) ) )
{
msg_Err( p_input, "failed to open a connection (udp)" );
#if defined( UNDER_CE )
CloseHandle( (HANDLE)p_access->socket_tcp.i_handle );
#elif defined( WIN32 )
closesocket( p_access->socket_tcp.i_handle );
#else
close( p_access->socket_tcp.i_handle );
#endif
return( -1 );
}
module_Unneed( p_input, p_network );
p_access->socket_udp.i_handle = socket_desc.i_handle;
p_input->i_mtu = 0;/*socket_desc.i_mtu; FIXME */
} }
/* *** Init context for mms prototcol *** */ /* *** Init context for mms prototcol *** */
GenerateGuid( &p_access->guid ); // used to identify client by server GenerateGuid( &p_access->guid ); /* used to identify client by server */
msg_Dbg( p_input, msg_Dbg( p_input,
"generated guid: "GUID_FMT, "generated guid: "GUID_FMT,
GUID_PRINT( p_access->guid ) ); GUID_PRINT( p_access->guid ) );
p_access->i_command_level = 1; // updated after 0x1A command p_access->i_command_level = 1; /* updated after 0x1A command */
p_access->i_seq_num = 0; p_access->i_seq_num = 0;
p_access->i_media_packet_id_type = 0x04; p_access->i_media_packet_id_type = 0x04;
p_access->i_header_packet_id_type = 0x02; p_access->i_header_packet_id_type = 0x02;
...@@ -777,6 +747,10 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -777,6 +747,10 @@ static int MMSOpen( input_thread_t *p_input,
p_access->i_media_used = 0; p_access->i_media_used = 0;
p_access->i_pos = 0; p_access->i_pos = 0;
p_access->i_buffer_tcp = 0;
p_access->i_buffer_udp = 0;
p_access->p_cmd = NULL;
p_access->i_cmd = 0;
/* *** send command 1 : connection request *** */ /* *** send command 1 : connection request *** */
var_buffer_initwrite( &buffer, 0 ); var_buffer_initwrite( &buffer, 0 );
...@@ -831,8 +805,17 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -831,8 +805,17 @@ static int MMSOpen( input_thread_t *p_input,
var_buffer_add32( &buffer, 0x00000000 ); var_buffer_add32( &buffer, 0x00000000 );
var_buffer_add32( &buffer, 0x000a0000 ); var_buffer_add32( &buffer, 0x000a0000 );
var_buffer_add32( &buffer, 0x00000002 ); var_buffer_add32( &buffer, 0x00000002 );
// FIXME wrong for UDP FIXME if( b_udp )
sprintf( tmp, "\\\\127.0.0.1\\%s\\1242", b_udp ? "UDP" : "TCP" ); {
sprintf( tmp,
"\\\\%s\\UDP\\%d",
p_url->psz_bind_addr,
p_url->i_bind_port );
}
else
{
sprintf( tmp, "\\\\127.0.0.1\\TCP\\1242" );
}
var_buffer_addUTF16( &buffer, tmp ); var_buffer_addUTF16( &buffer, tmp );
var_buffer_add16( &buffer, '0' ); var_buffer_add16( &buffer, '0' );
...@@ -844,7 +827,7 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -844,7 +827,7 @@ static int MMSOpen( input_thread_t *p_input,
buffer.i_data ); buffer.i_data );
/* *** response from server, should be 0x02 or 0x03 *** */ /* *** response from server, should be 0x02 or 0x03 *** */
mms_CommandRead( p_input, 0x02, 0 ); mms_CommandRead( p_input, 0x02, 0x03 );
if( p_access->i_command == 0x03 ) if( p_access->i_command == 0x03 )
{ {
msg_Err( p_input, msg_Err( p_input,
...@@ -861,7 +844,6 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -861,7 +844,6 @@ static int MMSOpen( input_thread_t *p_input,
/* *** send command 5 : media file name/path requested *** */ /* *** send command 5 : media file name/path requested *** */
var_buffer_reinitwrite( &buffer, 0 ); var_buffer_reinitwrite( &buffer, 0 );
var_buffer_add64( &buffer, 0 ); var_buffer_add64( &buffer, 0 );
// var_buffer_addUTF16( &buffer, "/" );
var_buffer_addUTF16( &buffer, p_url->psz_path ); var_buffer_addUTF16( &buffer, p_url->psz_path );
mms_CommandSend( p_input, mms_CommandSend( p_input,
...@@ -878,7 +860,7 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -878,7 +860,7 @@ static int MMSOpen( input_thread_t *p_input,
if( p_access->i_command == 0x1A ) if( p_access->i_command == 0x1A )
{ {
msg_Err( p_input, "id/password requested (not yet supported)" ); msg_Err( p_input, "id/password requested (not yet supported)" );
// FIXME /* FIXME */
var_buffer_free( &buffer ); var_buffer_free( &buffer );
MMSClose( p_input ); MMSClose( p_input );
return( -1 ); return( -1 );
...@@ -893,7 +875,7 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -893,7 +875,7 @@ static int MMSOpen( input_thread_t *p_input,
return( -1 ); return( -1 );
} }
// 1 for file ok, 2 for authen ok /* 1 for file ok, 2 for authen ok */
switch( GetDWLE( p_access->p_cmd + MMS_CMD_HEADERSIZE ) ) switch( GetDWLE( p_access->p_cmd + MMS_CMD_HEADERSIZE ) )
{ {
case 0x0001: case 0x0001:
...@@ -933,6 +915,9 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -933,6 +915,9 @@ static int MMSOpen( input_thread_t *p_input,
p_access->i_max_bit_rate, p_access->i_max_bit_rate,
p_access->i_header_size ); p_access->i_header_size );
/* XXX XXX dirty hack XXX XXX */
p_input->i_mtu = 3 * p_access->i_packet_length;
/* *** send command 15 *** */ /* *** send command 15 *** */
var_buffer_reinitwrite( &buffer, 0 ); var_buffer_reinitwrite( &buffer, 0 );
...@@ -968,15 +953,15 @@ static int MMSOpen( input_thread_t *p_input, ...@@ -968,15 +953,15 @@ static int MMSOpen( input_thread_t *p_input,
return( -1 ); return( -1 );
} }
/* *** parse header and get stream and their id *** */ /* *** parse header and get stream and their id *** */
// get all streams properties, /* get all streams properties,
// *
// TODO : stream bitrates properties(optional) * TODO : stream bitrates properties(optional)
// and bitrate mutual exclusion(optional) * and bitrate mutual exclusion(optional) */
asf_HeaderParse( p_access->stream, asf_HeaderParse( p_access->stream,
p_access->p_header, p_access->i_header ); p_access->p_header, p_access->i_header );
mms_StreamSelect( p_input, p_access->stream ); mms_StreamSelect( p_input, p_access->stream );
/* *** now select stream we want to receive *** */ /* *** now select stream we want to receive *** */
// TODO take care of stream bitrate TODO /* TODO take care of stream bitrate TODO */
i_streams = 0; i_streams = 0;
i_first = -1; i_first = -1;
var_buffer_reinitwrite( &buffer, 0 ); var_buffer_reinitwrite( &buffer, 0 );
...@@ -1061,9 +1046,8 @@ static int MMSStart ( input_thread_t *p_input, uint32_t i_packet ) ...@@ -1061,9 +1046,8 @@ static int MMSStart ( input_thread_t *p_input, uint32_t i_packet )
/* *** start stream from packet 0 *** */ /* *** start stream from packet 0 *** */