Commit 68e099d6 authored by Laurent Aimar's avatar Laurent Aimar

* mms: enable seek :) It works for me with both udp and tcp. Somebody

could check if it compiles on other OS than linux ? (I don't known what
headers should be included)
 * asf: fix to support seeking with mms
 Note: You cannot seek and use demuxdump demuxer...
parent 0f0ecaa9
This diff is collapsed.
......@@ -2,7 +2,7 @@
* mms.h: MMS access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.h,v 1.4 2002/11/25 00:22:04 fenrir Exp $
* $Id: mms.h,v 1.5 2002/11/25 15:08:34 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -73,6 +73,7 @@ typedef struct access_s
input_socket_t socket_tcp; /* TCP socket for communication with server */
input_socket_t socket_udp; /* Optional UDP socket for data(media/header packet) */
/* send by server */
char *psz_bind_addr; /* used by udp */
url_t url; /* connect to this server */
......@@ -108,6 +109,7 @@ typedef struct access_s
/* extracted informations */
int i_command;
int i_eos;
/* from 0x01 answer (not yet set) */
char *psz_server_version;
......
......@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.c,v 1.7 2002/11/19 17:23:21 fenrir Exp $
* $Id: asf.c,v 1.8 2002/11/25 15:08:34 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -77,7 +77,7 @@ static int Activate( vlc_object_t * p_this )
if( p_input->i_mtu == 0 )
{
/* Improve speed. */
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE ;
p_input->i_bufsize = INPUT_DEFAULT_BUFSIZE;
}
p_input->pf_demux = Demux;
......@@ -403,7 +403,8 @@ static int Demux( input_thread_t *p_input )
i_offset = 0;
}
/* XXX work only when i_min_data_packet_size == i_max_data_packet_size */
i_offset -= i_offset % p_demux->p_fp->i_min_data_packet_size;
i_offset += p_demux->p_fp->i_min_data_packet_size -
i_offset % p_demux->p_fp->i_min_data_packet_size;
ASF_SeekAbsolute( p_input, p_demux->i_data_begin + i_offset );
p_demux->i_time = 0;
......@@ -416,6 +417,7 @@ static int Demux( input_thread_t *p_input )
}
#undef p_stream
}
p_demux->i_first_pts = -1;
}
......
......@@ -2,7 +2,7 @@
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.6 2002/11/14 16:17:47 fenrir Exp $
* $Id: libasf.c,v 1.7 2002/11/25 15:08:34 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -117,8 +117,16 @@ int ASF_SeekAbsolute( input_thread_t *p_input,
return( 1 );
}
if( !p_input->stream.b_seekable && i_pos < i_filepos )
{
msg_Err( p_input, "cannot seek" );
return( 0 );
}
if( p_input->stream.b_seekable &&
p_input->stream.i_method != INPUT_METHOD_NETWORK )
( p_input->stream.i_method == INPUT_METHOD_FILE ||
i_pos < i_filepos ||
i_pos - i_filepos > 10000 ) )
{
p_input->pf_seek( p_input, i_pos );
input_AccessReinit( p_input );
......@@ -142,14 +150,8 @@ int ASF_SeekAbsolute( input_thread_t *p_input,
i_size -= i_read;
} while( i_size > 0 );
return( 1 );
}
else
{
msg_Err( p_input, "cannot seek" );
return( 0 );
}
return( 1 );
}
/* return 1 if success, 0 if fail */
......
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