Commit 7902c7a6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream: rename p_source to s (refs #18504)

parent cf542f06
......@@ -57,7 +57,7 @@ struct stream_t
bool b_preparsing; /**< True if this access is used to preparse */
/* Stream source for stream filter */
stream_t *p_source;
stream_t *s;
/**
* Read data.
......
......@@ -560,7 +560,7 @@ static void Close( vlc_object_t *p_this )
if ( p_sys->arib.b25stream )
{
p_sys->arib.b25stream->p_source = NULL; /* don't chain kill demuxer's source */
p_sys->arib.b25stream->s = NULL; /* don't chain kill demuxer's source */
vlc_stream_Delete( p_sys->arib.b25stream );
}
......
......@@ -135,7 +135,7 @@ static void ReadElement( xml_reader_t *p_xml_reader, char **ppsz_txt )
static bool PeekASX( stream_t *s )
{
const uint8_t *p_peek;
return ( vlc_stream_Peek( s->p_source, &p_peek, 12 ) == 12
return ( vlc_stream_Peek( s->s, &p_peek, 12 ) == 12
&& !memcmp( p_peek, "<asx version", 12 ) );
}
......@@ -149,7 +149,7 @@ int Import_ASX( vlc_object_t *p_this )
CHECK_FILE(p_demux);
char *type = stream_MimeType( p_demux->p_source );
char *type = stream_MimeType( p_demux->s );
if( stream_HasExtension( p_demux, ".asx" )
|| stream_HasExtension( p_demux, ".wax" )
......@@ -320,7 +320,7 @@ end:
static stream_t* UTF8Stream( stream_t *p_demux )
{
stream_t *s = p_demux->p_source;
stream_t *s = p_demux->s;
uint64_t streamSize;
if (vlc_stream_GetSize( s, &streamSize ) != VLC_SUCCESS)
......@@ -380,7 +380,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
int i_n_entry = 0;
p_xml_reader = xml_ReaderCreate( p_demux, p_stream ? p_stream
: p_demux->p_source );
: p_demux->s );
if( !p_xml_reader )
{
msg_Err( p_demux, "Cannot parse ASX input file as XML");
......
......@@ -72,9 +72,9 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
input_item_t *p_current_input = GetCurrentItem(p_demux);
free( vlc_stream_ReadLine( p_demux->p_source ) );
free( vlc_stream_ReadLine( p_demux->s ) );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
return -1;
......
......@@ -52,7 +52,7 @@ int Import_DVB(vlc_object_t *p_this)
/* Check if this really is a channels file */
const uint8_t *peek;
int len = vlc_stream_Peek(demux->p_source, &peek, 1023);
int len = vlc_stream_Peek(demux->s, &peek, 1023);
if (len <= 0)
return VLC_EGENERIC;
......@@ -82,7 +82,7 @@ static int ReadDir(stream_t *s, input_item_node_t *subitems)
{
char *line;
while ((line = vlc_stream_ReadLine(s->p_source)) != NULL)
while ((line = vlc_stream_ReadLine(s->s)) != NULL)
{
input_item_t *item = ParseLine(line);
free(line);
......
......@@ -64,7 +64,7 @@ int Import_IFO( vlc_object_t *p_this )
&& !strcasecmp( psz_file + strlen( "VTS_00_0" ) , ".IFO" ) ) ) )
{
const uint8_t *p_peek;
ssize_t i_peek = vlc_stream_Peek( p_demux->p_source, &p_peek, 8 );
ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 8 );
if( i_peek != 8 || memcmp( p_peek, "DVDVIDEO", 8 ) )
return VLC_EGENERIC;
......@@ -75,7 +75,7 @@ int Import_IFO( vlc_object_t *p_this )
else if( len >= 12 && !strcmp( &p_demux->psz_filepath[len-12], "VR_MANGR.IFO" ) )
{
const uint8_t *p_peek;
ssize_t i_peek = vlc_stream_Peek( p_demux->p_source, &p_peek, 8 );
ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 8 );
if( i_peek != 8 || memcmp( p_peek, "DVD_RTR_", 8 ) )
return VLC_EGENERIC;
......
......@@ -52,7 +52,7 @@ int Import_iTML( vlc_object_t *p_this )
return VLC_EGENERIC;
const uint8_t *p_peek;
const ssize_t i_peek = vlc_stream_Peek( p_demux->p_source, &p_peek, 128 );
const ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 128 );
if ( i_peek < 32 ||
!strnstr( (const char *) p_peek, "<!DOCTYPE plist ", i_peek ) )
return VLC_EGENERIC;
......@@ -76,7 +76,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
p_demux->p_sys = (void *)(uintptr_t)0;
/* create new xml parser from stream */
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
goto end;
......
......@@ -82,7 +82,7 @@ int Import_M3U( vlc_object_t *p_this )
int offset = 0;
CHECK_FILE(p_stream);
i_peek = vlc_stream_Peek( p_stream->p_source, &p_peek, 1024 );
i_peek = vlc_stream_Peek( p_stream->s, &p_peek, 1024 );
if( i_peek < 8 )
return VLC_EGENERIC;
......@@ -104,7 +104,7 @@ int Import_M3U( vlc_object_t *p_this )
}
/* File type: playlist, or not (HLS manifest or whatever else) */
char *type = stream_MimeType(p_stream->p_source);
char *type = stream_MimeType(p_stream->s);
bool match;
if (p_stream->obj.force)
......@@ -137,7 +137,7 @@ int Import_M3U( vlc_object_t *p_this )
if (!match)
return VLC_EGENERIC;
if (offset != 0 && vlc_stream_Seek(p_stream->p_source, offset))
if (offset != 0 && vlc_stream_Seek(p_stream->s, offset))
return VLC_EGENERIC;
msg_Dbg( p_stream, "found valid M3U playlist" );
......@@ -226,7 +226,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
input_item_t *p_current_input = GetCurrentItem(p_demux);
psz_line = vlc_stream_ReadLine( p_demux->p_source );
psz_line = vlc_stream_ReadLine( p_demux->s );
while( psz_line )
{
char *psz_parse = psz_line;
......@@ -327,7 +327,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
/* Fetch another line */
free( psz_line );
psz_line = vlc_stream_ReadLine( p_demux->p_source );
psz_line = vlc_stream_ReadLine( p_demux->s );
if( !psz_line ) b_cleanup = true;
if( b_cleanup )
......
......@@ -58,7 +58,7 @@ int Import_WPL ( vlc_object_t * );
void Close_WPL ( vlc_object_t * );
#define GetCurrentItem(obj) input_GetItem((obj)->p_input)
#define GetSource(obj) ((obj)->p_source)
#define GetSource(obj) ((obj)->s)
#define CHECK_FILE(obj) \
do { \
......
......@@ -49,7 +49,7 @@ int Import_PLS( vlc_object_t *p_this )
CHECK_FILE(p_demux);
if( vlc_stream_Peek( p_demux->p_source , &p_peek, 10 ) < 10 ) {
if( vlc_stream_Peek( p_demux->s, &p_peek, 10 ) < 10 ) {
msg_Dbg( p_demux, "not enough data" );
return VLC_EGENERIC;
}
......@@ -79,7 +79,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
input_item_t *p_current_input = GetCurrentItem(p_demux);
while( ( psz_line = vlc_stream_ReadLine( p_demux->p_source ) ) )
while( ( psz_line = vlc_stream_ReadLine( p_demux->s ) ) )
{
if( !strncasecmp( psz_line, "[playlist]", sizeof("[playlist]")-1 ) ||
!strncasecmp( psz_line, "[Reference]", sizeof("[Reference]")-1 ) )
......
......@@ -49,19 +49,19 @@ int Import_podcast( vlc_object_t *p_this )
stream_t *p_demux = (stream_t *)p_this;
CHECK_FILE(p_demux);
if( stream_IsMimeType( p_demux->p_source, "text/xml" )
|| stream_IsMimeType( p_demux->p_source, "application/xml" ) )
if( stream_IsMimeType( p_demux->s, "text/xml" )
|| stream_IsMimeType( p_demux->s, "application/xml" ) )
{
/* XML: check if the root node is "rss". Use a specific peeked
* probestream in order to not modify the source state while probing.
* */
const uint8_t *p_peek;
ssize_t i_peek = vlc_stream_Peek( p_demux->p_source, &p_peek, 2048 );
ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 2048 );
if( unlikely( i_peek <= 0 ) )
return VLC_EGENERIC;
stream_t *p_probestream =
vlc_stream_MemoryNew( p_demux->p_source, (uint8_t *)p_peek, i_peek, true );
vlc_stream_MemoryNew( p_demux, (uint8_t *)p_peek, i_peek, true );
if( unlikely( !p_probestream ) )
return VLC_EGENERIC;
......@@ -86,7 +86,7 @@ int Import_podcast( vlc_object_t *p_this )
vlc_stream_Delete( p_probestream );
/* SUCCESS: this text/xml is a rss file */
}
else if( !stream_IsMimeType( p_demux->p_source, "application/rss+xml" ) )
else if( !stream_IsMimeType( p_demux->s, "application/rss+xml" ) )
return VLC_EGENERIC;
p_demux->pf_readdir = ReadDir;
......@@ -122,7 +122,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
input_item_t *p_current_input = GetCurrentItem(p_demux);
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
goto error;
......
......@@ -117,7 +117,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
char *psz_mimetype = NULL;
int i_volume = 100;
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
goto error;
......
......@@ -80,7 +80,7 @@ int Import_RAM( vlc_object_t *p_this )
return VLC_EGENERIC;
/* Many Real Media Files are misdetected */
if( vlc_stream_Peek( p_demux->p_source, &p_peek, 4 ) < 4 )
if( vlc_stream_Peek( p_demux->s, &p_peek, 4 ) < 4 )
return VLC_EGENERIC;
if( !memcmp( p_peek, ".ra", 3 ) || !memcmp( p_peek, ".RMF", 4 ) )
{
......@@ -208,7 +208,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
bool b_cleanup = false;
input_item_t *p_input;
psz_line = vlc_stream_ReadLine( p_demux->p_source );
psz_line = vlc_stream_ReadLine( p_demux->s );
while( psz_line )
{
char *psz_parse = psz_line;
......@@ -346,7 +346,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
error:
/* Fetch another line */
free( psz_line );
psz_line = vlc_stream_ReadLine( p_demux->p_source );
psz_line = vlc_stream_ReadLine( p_demux->s );
if( !psz_line ) b_cleanup = true;
if( b_cleanup )
......
......@@ -142,7 +142,7 @@ int Import_SGIMB( vlc_object_t * p_this )
CHECK_FILE(p_demux);
/* Lets check the content to see if this is a sgi mediabase file */
i_size = vlc_stream_Peek( p_demux->p_source, &p_peek, MAX_LINE );
i_size = vlc_stream_Peek( p_demux->s, &p_peek, MAX_LINE );
i_size -= sizeof("sgiNameServerHost=") - 1;
if ( i_size > 0 )
{
......@@ -324,7 +324,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *node )
input_item_t *p_child = NULL;
char *psz_line;
while( ( psz_line = vlc_stream_ReadLine( p_demux->p_source ) ) )
while( ( psz_line = vlc_stream_ReadLine( p_demux->s ) ) )
{
ParseLine( p_demux, psz_line );
free( psz_line );
......
......@@ -74,7 +74,7 @@ static int Demux( stream_t *p_demux, input_item_node_t *p_input_node )
const char *node;
int i_ret = VLC_EGENERIC;
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
if( !p_xml_reader )
goto error;
......
......@@ -285,11 +285,11 @@ int Import_WPL( vlc_object_t* p_this )
return VLC_EGENERIC;
const uint8_t *p_peek;
ssize_t i_peek = vlc_stream_Peek( p_demux->p_source, &p_peek, 2048 );
ssize_t i_peek = vlc_stream_Peek( p_demux->s, &p_peek, 2048 );
if( unlikely( i_peek <= 0 ) )
return VLC_EGENERIC;
stream_t *p_probestream = vlc_stream_MemoryNew( p_demux->p_source, (uint8_t *)p_peek, i_peek, true );
stream_t *p_probestream = vlc_stream_MemoryNew( p_demux, (uint8_t *)p_peek, i_peek, true );
if( unlikely( !p_probestream ) )
return VLC_EGENERIC;
......@@ -315,7 +315,7 @@ int Import_WPL( vlc_object_t* p_this )
return VLC_EGENERIC;
}
p_demux->p_sys = xml_ReaderReset( p_reader, p_demux->p_source );
p_demux->p_sys = xml_ReaderReset( p_reader, p_demux->s );
vlc_stream_Delete( p_probestream );
if( unlikely( p_demux->p_sys == NULL ) )
return VLC_EGENERIC;
......
......@@ -92,7 +92,7 @@ int Import_xspf(vlc_object_t *p_this)
CHECK_FILE(p_stream);
if( !stream_HasExtension( p_stream, ".xspf" )
&& !stream_IsMimeType( p_stream->p_source, "application/xspf+xml" ) )
&& !stream_IsMimeType( p_stream->s, "application/xspf+xml" ) )
return VLC_EGENERIC;
xspf_sys_t *sys = calloc(1, sizeof (*sys));
......@@ -135,7 +135,7 @@ static int ReadDir(stream_t *p_stream, input_item_node_t *p_subitems)
sys->psz_base = strdup(p_stream->psz_url);
/* create new xml parser from stream */
p_xml_reader = xml_ReaderCreate(p_stream, p_stream->p_source);
p_xml_reader = xml_ReaderCreate(p_stream, p_stream->s);
if (!p_xml_reader)
goto end;
......
......@@ -55,7 +55,7 @@ static int vlclua_demux_peek( lua_State *L )
int n = luaL_checkint( L, 1 );
const uint8_t *p_peek;
ssize_t val = vlc_stream_Peek(s->p_source, &p_peek, n);
ssize_t val = vlc_stream_Peek(s->s, &p_peek, n);
if (val > 0)
lua_pushlstring(L, (const char *)p_peek, val);
else
......@@ -71,7 +71,7 @@ static int vlclua_demux_read( lua_State *L )
if (buf != NULL)
{
ssize_t val = vlc_stream_Read(s->p_source, buf, n);
ssize_t val = vlc_stream_Read(s->s, buf, n);
if (val > 0)
lua_pushlstring(L, buf, val);
else
......@@ -87,7 +87,7 @@ static int vlclua_demux_read( lua_State *L )
static int vlclua_demux_readline( lua_State *L )
{
stream_t *s = (stream_t *)vlclua_get_this(L);
char *line = vlc_stream_ReadLine(s->p_source);
char *line = vlc_stream_ReadLine(s->s);
if (line != NULL)
{
......@@ -279,7 +279,7 @@ int Import_LuaPlaylist(vlc_object_t *obj)
return VLC_EGENERIC;
stream_t *s = (stream_t *)obj;
if( !vlc_stream_Control( s->p_source, STREAM_IS_DIRECTORY ) )
if( !vlc_stream_Control( s->s, STREAM_IS_DIRECTORY ) )
return VLC_EGENERIC;
struct vlclua_playlist *sys = malloc(sizeof (*sys));
......
......@@ -88,12 +88,12 @@ static int Control( stream_t *p_stream, int i_query, va_list args )
break;
}
return vlc_stream_vaControl( p_stream->p_source, i_query, args );
return vlc_stream_vaControl( p_stream->s, i_query, args );
}
static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
{
return vlc_stream_Read( s->p_source, buffer, i_read );
return vlc_stream_Read( s->s, buffer, i_read );
}
static int Seek( stream_t *s, uint64_t offset )
......@@ -101,7 +101,7 @@ static int Seek( stream_t *s, uint64_t offset )
stream_sys_t *p_sys = s->p_sys;
assert( p_sys->b_seek );
return vlc_stream_Seek( s->p_source, offset );
return vlc_stream_Seek( s->s, offset );
}
static int Open( vlc_object_t *p_object )
......@@ -120,7 +120,7 @@ static int Open( vlc_object_t *p_object )
if (!p_sys->b_seek)
{
if (vlc_stream_Control(p_stream->p_source, STREAM_CAN_SEEK, &b) == 0)
if (vlc_stream_Control(p_stream->s, STREAM_CAN_SEEK, &b) == 0)
used = b;
p_sys->b_fastseek = false;
......@@ -129,12 +129,12 @@ static int Open( vlc_object_t *p_object )
{
p_sys->b_fastseek = var_InheritBool(p_stream, "fastseek");
if (!p_sys->b_fastseek
&& vlc_stream_Control(p_stream->p_source, STREAM_CAN_FASTSEEK,
&& vlc_stream_Control(p_stream->s, STREAM_CAN_FASTSEEK,
&b) == 0)
used = b;
}
if (!p_sys->b_size && vlc_stream_GetSize(p_stream->p_source, &size) == 0)
if (!p_sys->b_size && vlc_stream_GetSize(p_stream->s, &size) == 0)
used = true;
if (!used) /* Nothing to do: skip this filter */
......
......@@ -45,12 +45,12 @@ vlc_module_end()
static int Control( stream_t *p_stream, int i_query, va_list args )
{
return vlc_stream_vaControl( p_stream->p_source, i_query, args );
return vlc_stream_vaControl( p_stream->s, i_query, args );
}
static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
{
const ssize_t i_ret = vlc_stream_Read( s->p_source, buffer, i_read );
const ssize_t i_ret = vlc_stream_Read( s->s, buffer, i_read );
if( i_ret < 1 ) return i_ret;
uint8_t *p_buffer = buffer;
......@@ -62,7 +62,7 @@ static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
static int Seek( stream_t *s, uint64_t offset )
{
return vlc_stream_Seek( s->p_source, offset );
return vlc_stream_Seek( s->s, offset );
}
static int Open( vlc_object_t *p_object )
......@@ -80,7 +80,7 @@ static int Open( vlc_object_t *p_object )
}
const uint8_t *peek;
if( vlc_stream_Peek( p_stream->p_source, &peek, 3 ) < 3 )
if( vlc_stream_Peek( p_stream->s, &peek, 3 ) < 3 )
return VLC_EGENERIC;
/* Probe for XOR'd ID3 tag. */
......
......@@ -182,7 +182,7 @@ static ssize_t Read( stream_t *p_stream, void *p_buf, size_t i_toread )
while ( i_toread )
{
/* make use of the existing buffer, overwritten by decoder data later */
int i_srcread = vlc_stream_Read( p_stream->p_source, p_dst, i_toread );
int i_srcread = vlc_stream_Read( p_stream->s, p_dst, i_toread );
if ( i_srcread > 0 )
{
ARIB_STD_B25_BUFFER putbuf = { p_dst, i_srcread };
......@@ -233,7 +233,7 @@ static ssize_t Read( stream_t *p_stream, void *p_buf, size_t i_toread )
static int Seek( stream_t *p_stream, uint64_t i_pos )
{
int i_ret = vlc_stream_Seek( p_stream->p_source, i_pos );
int i_ret = vlc_stream_Seek( p_stream->s, i_pos );
if ( i_ret == VLC_SUCCESS )
RemainFlush( p_stream->p_sys );
return i_ret;
......@@ -244,14 +244,14 @@ static int Seek( stream_t *p_stream, uint64_t i_pos )
*/
static int Control( stream_t *p_stream, int i_query, va_list args )
{
return vlc_stream_vaControl( p_stream->p_source, i_query, args );
return vlc_stream_vaControl( p_stream->s, i_query, args );
}
static int Open( vlc_object_t *p_object )
{
stream_t *p_stream = (stream_t *) p_object;
int64_t i_stream_size = stream_Size( p_stream->p_source );
int64_t i_stream_size = stream_Size( p_stream->s );
if ( i_stream_size > 0 && i_stream_size < ARIB_STD_B25_TS_PROBING_MIN_DATA )
return VLC_EGENERIC;
......
......@@ -119,9 +119,9 @@ static int AStreamRefillBlock(stream_t *s)
return VLC_EGENERIC;
/* Fetch a block */
if ((b = vlc_stream_ReadBlock(s->p_source)))
if ((b = vlc_stream_ReadBlock(s->s)))
break;
if (vlc_stream_Eof(s->p_source))
if (vlc_stream_Eof(s->s))
return VLC_EGENERIC;
}
......@@ -176,10 +176,10 @@ static void AStreamPrebufferBlock(stream_t *s)
}
/* Fetch a block */
block_t *b = vlc_stream_ReadBlock(s->p_source);
block_t *b = vlc_stream_ReadBlock(s->s);
if (b == NULL)
{
if (vlc_stream_Eof(s->p_source))
if (vlc_stream_Eof(s->s))
break;
continue;
}
......@@ -259,7 +259,7 @@ static int AStreamSeekBlock(stream_t *s, uint64_t i_pos)
if (i_offset < 0)
{
bool b_aseek;
vlc_stream_Control(s->p_source, STREAM_CAN_SEEK, &b_aseek);
vlc_stream_Control(s->s, STREAM_CAN_SEEK, &b_aseek);
if (!b_aseek)
{
......@@ -273,8 +273,8 @@ static int AStreamSeekBlock(stream_t *s, uint64_t i_pos)
{
bool b_aseek, b_aseekfast;
vlc_stream_Control(s->p_source, STREAM_CAN_SEEK, &b_aseek);
vlc_stream_Control(s->p_source, STREAM_CAN_FASTSEEK, &b_aseekfast);
vlc_stream_Control(s->s, STREAM_CAN_SEEK, &b_aseek);
vlc_stream_Control(s->s, STREAM_CAN_FASTSEEK, &b_aseekfast);
if (!b_aseek)
{
......@@ -305,7 +305,7 @@ static int AStreamSeekBlock(stream_t *s, uint64_t i_pos)
if (b_seek)
{
/* Do the access seek */
if (vlc_stream_Seek(s->p_source, i_pos)) return VLC_EGENERIC;
if (vlc_stream_Seek(s->s, i_pos)) return VLC_EGENERIC;
/* Release data */
block_ChainRelease(sys->p_first);
......@@ -416,12 +416,12 @@ static int AStreamControl(stream_t *s, int i_query, va_list args)
case STREAM_SET_PRIVATE_ID_STATE:
case STREAM_SET_PRIVATE_ID_CA:
case STREAM_GET_PRIVATE_ID_STATE:
return vlc_stream_vaControl(s->p_source, i_query, args);
return vlc_stream_vaControl(s->s, i_query, args);
case STREAM_SET_TITLE:
case STREAM_SET_SEEKPOINT:
{
int ret = vlc_stream_vaControl(s->p_source, i_query, args);
int ret = vlc_stream_vaControl(s->s, i_query, args);
if (ret == VLC_SUCCESS)
AStreamControlReset(s);
return ret;
......
......@@ -134,7 +134,7 @@ static int AStreamRefillStream(stream_t *s)
return VLC_EGENERIC;
i_read = __MIN(i_toread, STREAM_CACHE_TRACK_SIZE - i_off);
i_read = vlc_stream_Read(s->p_source, &tk->p_buffer[i_off], i_read);
i_read = vlc_stream_Read(s->s, &tk->p_buffer[i_off], i_read);
/* msg_Dbg(s, "AStreamRefillStream: read=%d", i_read); */
if (i_read < 0)
......@@ -200,8 +200,7 @@ static void AStreamPrebufferStream(stream_t *s)
i_read = STREAM_CACHE_TRACK_SIZE - i_buffered;
i_read = __MIN((int)sys->i_read_size, i_read);
i_read = vlc_stream_Read(s->p_source, &tk->p_buffer[i_buffered],
i_read);
i_read = vlc_stream_Read(s->s, &tk->p_buffer[i_buffered], i_read);
if (i_read < 0)
continue;
else if (i_read == 0)
......@@ -307,7 +306,7 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
#endif
bool b_aseek;
vlc_stream_Control(s->p_source, STREAM_CAN_SEEK, &b_aseek);
vlc_stream_Control(s->s, STREAM_CAN_SEEK, &b_aseek);
if (!b_aseek && i_pos < p_current->i_start)
{
msg_Warn(s, "AStreamSeekStream: can't seek");
......@@ -315,7 +314,7 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
}
bool b_afastseek;
vlc_stream_Control(s->p_source, STREAM_CAN_FASTSEEK, &b_afastseek);
vlc_stream_Control(s->s, STREAM_CAN_FASTSEEK, &b_afastseek);
/* FIXME compute seek cost (instead of static 'stupid' value) */
uint64_t i_skip_threshold;
......@@ -387,7 +386,7 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
/* Seek at the end of the buffer
* TODO it is stupid to seek now, it would be better to delay it
*/
if (vlc_stream_Seek(s->p_source, tk->i_end))
if (vlc_stream_Seek(s->s, tk->i_end))
{
msg_Err(s, "AStreamSeekStream: hard seek failed");
return VLC_EGENERIC;
......@@ -416,7 +415,7 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
msg_Err(s, "AStreamSeekStream: hard seek");
#endif
/* Nothing good, seek and choose oldest segment */
if (vlc_stream_Seek(s->p_source, i_pos))
if (vlc_stream_Seek(s->s, i_pos))
{
msg_Err(s, "AStreamSeekStream: hard seek failed");
return VLC_EGENERIC;
......@@ -470,12 +469,12 @@ static int AStreamControl(stream_t *s, int i_query, va_list args)
case STREAM_SET_PRIVATE_ID_STATE:
case STREAM_SET_PRIVATE_ID_CA:
case STREAM_GET_PRIVATE_ID_STATE:
return vlc_stream_vaControl(s->p_source, i_query, args);
return vlc_stream_vaControl(s->s, i_query, args);
case STREAM_SET_TITLE:
case STREAM_SET_SEEKPOINT:
{
int ret = vlc_stream_vaControl(s->p_source, i_query, args);
int ret = vlc_stream_vaControl(s->s, i_query, args);
if (ret == VLC_SUCCESS)
AStreamControlReset(s);
return ret;
......
......@@ -137,7 +137,7 @@ static void *Thread (void *data)
vlc_mutex_lock (&p_sys->lock);
while (p_sys->paused) /* practically always false, but... */
vlc_cond_wait (&p_sys->wait, &p_sys->lock);
len = vlc_stream_Read (stream->p_source, buf, bufsize);
len = vlc_stream_Read (stream->s, buf, bufsize);
vlc_mutex_unlock (&p_sys->lock);
vlc_restorecancel (canc);
......@@ -229,8 +229,7 @@ static int Control (stream_t *stream, int query, va_list args)
bool paused = va_arg (args, unsigned);
vlc_mutex_lock (&p_sys->lock);
vlc_stream_Control(stream->p_source, STREAM_SET_PAUSE_STATE,
paused);
vlc_stream_Control(stream->s, STREAM_SET_PAUSE_STATE, paused);
p_sys->paused = paused;
vlc_cond_signal (&p_sys->wait);
vlc_mutex_unlock (&p_sys->lock);
......@@ -257,11 +256,9 @@ static int Open (stream_t *stream, const char *path)
vlc_mutex_init (&p_sys->lock);
p_sys->paused = false;
p_sys->pid = -1;
vlc_stream_Control(stream->p_source, STREAM_CAN_PAUSE, &p_sys->can_pause);
vlc_stream_Control(stream->p_source, STREAM_CAN_CONTROL_PACE,
&p_sys->can_pace);
vlc_stream_Control(stream->p_source, STREAM_GET_PTS_DELAY,
&p_sys->pts_delay);
vlc_stream_Control(stream->s, STREAM_CAN_PAUSE, &p_sys->can_pause);
vlc_stream_Control(stream->s, STREAM_CAN_CONTROL_PACE, &p_sys->can_pace);
vlc_stream_Control(stream->s, STREAM_GET_PTS_DELAY, &p_sys->pts_delay);
/* I am not a big fan of the pyramid style, but I cannot think of anything
* better here. There are too many failure cases. */
......@@ -378,7 +375,7 @@ static int OpenGzip (vlc_object_t *obj)
stream_t *stream = (stream_t *)obj;
const uint8_t *peek;
if (vlc_stream_Peek (stream->p_source, &peek, 3) < 3)
if (vlc_stream_Peek (stream->s, &peek, 3) < 3)
return VLC_EGENERIC;
if (memcmp (peek, "\x1f\x8b\x08", 3))
......@@ -398,7 +395,7 @@ static int OpenBzip2 (vlc_object_t *obj)
const uint8_t *peek;
/* (Try to) parse the bzip2 header */
if (vlc_stream_Peek (stream->p_source, &peek, 10) < 10)
if (vlc_stream_Peek (stream->s, &peek, 10) < 10)
return VLC_EGENERIC;
if (memcmp (peek, "BZh", 3) || (peek[3] < '1') || (peek[3] > '9')
......@@ -418,7 +415,7 @@ static int OpenXZ (vlc_object_t *obj)
const uint8_t *peek;
/* (Try to) parse the xz stream header */
if (vlc_stream_Peek (stream->p_source, &peek, 8) < 8)
if (vlc_stream_Peek (stream->s, &peek, 8) < 8)
return VLC_EGENERIC;
if (memcmp (peek, "\xfd\x37\x7a\x58\x5a", 6))
......
......@@ -223,7 +223,7 @@ static inline bool isFQUrl( const char* url )
static bool isHDS( stream_t *s )
{
const uint8_t *peek;
int i_size = vlc_stream_Peek( s->p_source, &peek, 200 );
int i_size = vlc_stream_Peek( s->s, &peek, 200 );
if( i_size < 200 )
return false;
......@@ -1181,7 +1181,7 @@ static void* live_thread( void* p )
static int init_Manifest( stream_t *s, manifest_t *m )
{
memset(m, 0, sizeof(*m));
stream_t *st = s->p_source;
stream_t *st = s->s;
m->vlc_reader = xml_ReaderCreate( st, st );
if( !m->vlc_reader )
......
......@@ -56,7 +56,7 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
if (val > 0)
{ /* Fill input buffer if there is space left */
val = vlc_stream_Read(stream->p_source,
val = vlc_stream_Read(stream->s,
sys->zstream.next_in + sys->zstream.avail_in, val);
if (val >= 0)
sys->zstream.avail_in += val;
......@@ -121,7 +121,7 @@ static int Control(stream_t *stream, int query, va_list args)
case STREAM_GET_CONTENT_TYPE:
case STREAM_GET_SIGNAL:
case STREAM_SET_PAUSE_STATE: