Commit e4fbdceb authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

stream: rename vlc_stream_NewMRL to vlc_stream_NewURL

The function does not open MRLs, as correctly described in its
documentation, as such it is rather unfortunate that its name uses MRL
instead of URL (especially given that it cannot handle MRLs).

These changes are simply renaming all occurrences of the function, so
that the behavior of the function is properly reflected by its name.
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent a7e4516f
......@@ -345,9 +345,9 @@ VLC_API stream_t *vlc_stream_MemoryNew(vlc_object_t *obj, uint8_t *base,
* Create a stream_t reading from a URL.
* You must delete it using vlc_stream_Delete.
*/
VLC_API stream_t * vlc_stream_NewMRL(vlc_object_t *obj, const char *url)
VLC_API stream_t * vlc_stream_NewURL(vlc_object_t *obj, const char *url)
VLC_USED;
#define vlc_stream_NewMRL(a, b) vlc_stream_NewMRL(VLC_OBJECT(a), b)
#define vlc_stream_NewURL(a, b) vlc_stream_NewURL(VLC_OBJECT(a), b)
/**
* \defgroup stream_fifo FIFO stream
......
......@@ -117,7 +117,7 @@ static int FindVolumes(access_t *p_access, struct archive *p_archive, const char
/* Probe URI */
int i_savedflags = p_access->obj.flags;
p_access->obj.flags |= OBJECT_FLAGS_NOINTERACT;
stream_t *p_stream = vlc_stream_NewMRL(p_access, psz_newuri);
stream_t *p_stream = vlc_stream_NewURL(p_access, psz_newuri);
p_access->obj.flags = i_savedflags;
if (p_stream)
{
......@@ -221,7 +221,7 @@ static int SwitchCallback(struct archive *p_archive, void *p_object, void *p_obj
msg_Dbg(p_data->p_access, "opening next volume %s", p_nextdata->psz_uri);
vlc_stream_Delete(p_sys->p_stream);
p_sys->p_stream = vlc_stream_NewMRL(p_nextdata->p_access, p_nextdata->psz_uri);
p_sys->p_stream = vlc_stream_NewURL(p_nextdata->p_access, p_nextdata->psz_uri);
return p_sys->p_stream ? ARCHIVE_OK : ARCHIVE_FATAL;
}
......@@ -231,7 +231,7 @@ static int OpenCallback(struct archive *p_archive, void *p_object)
callback_data_t *p_data = (callback_data_t *) p_object;
access_sys_t *p_sys = p_data->p_access->p_sys;
p_sys->p_stream = vlc_stream_NewMRL( p_data->p_access, p_data->psz_uri );
p_sys->p_stream = vlc_stream_NewURL( p_data->p_access, p_data->psz_uri );
if(!p_sys->p_stream)
return ARCHIVE_FATAL;
......
......@@ -724,7 +724,7 @@ int XmlFile::OpenXml()
char *psz_uri;
psz_uri = vlc_path2uri( this->s_path.c_str(), "file" );
this->p_stream = vlc_stream_NewMRL(this->p_demux, psz_uri );
this->p_stream = vlc_stream_NewURL(this->p_demux, psz_uri );
free(psz_uri);
if( ! this->p_stream ) {
return -1;
......
......@@ -66,7 +66,7 @@ static int Seek(access_t *access, uint64_t position)
if (strcmp(old_chunk->mrl, sys->chunk->mrl)) {
if (sys->s)
vlc_stream_Delete(sys->s);
sys->s = vlc_stream_NewMRL(access, sys->chunk->mrl);
sys->s = vlc_stream_NewURL(access, sys->chunk->mrl);
}
return sys->s ? vlc_stream_Seek(sys->s, offset) : VLC_EGENERIC;
}
......@@ -152,7 +152,7 @@ int RarAccessOpen(vlc_object_t *object)
name++;
vlc_uri_decode(base);
stream_t *s = vlc_stream_NewMRL(access, base);
stream_t *s = vlc_stream_NewURL(access, base);
if (!s || RarProbe(s))
goto error;
......
......@@ -396,7 +396,7 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file, unsigned int *pi_nbvol
const int s_flags = s->obj.flags;
s->obj.flags |= OBJECT_FLAGS_NOINTERACT;
vol = vlc_stream_NewMRL(s, volume_mrl);
vol = vlc_stream_NewURL(s, volume_mrl);
s->obj.flags = s_flags;
if (!vol) {
......
......@@ -315,7 +315,7 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
strcpy( fileUri, file );
}
stream_t *s = vlc_stream_NewMRL( p_access, fileUri );
stream_t *s = vlc_stream_NewURL( p_access, fileUri );
free( fileUri );
return s;
}
......
......@@ -399,7 +399,7 @@ int StreamUrlConnection::request(const std::string &path, const BytesRange &rang
msg_Dbg(p_object, "Retrieving %s @%zu", params.getUrl().c_str(),
range.isValid() ? range.getStartByte() : 0);
p_streamurl = vlc_stream_NewMRL(p_object, params.getUrl().c_str());
p_streamurl = vlc_stream_NewURL(p_object, params.getUrl().c_str());
if(!p_streamurl)
return VLC_EGENERIC;
......
......@@ -203,7 +203,7 @@ static int Open( vlc_object_t * p_this )
const uint8_t *p_peek;
bool file_ok = false;
char *psz_url = vlc_path2uri( s_filename.c_str(), "file" );
stream_t *p_file_stream = vlc_stream_NewMRL(
stream_t *p_file_stream = vlc_stream_NewURL(
p_demux,
psz_url );
/* peek the begining */
......
......@@ -186,7 +186,7 @@ static int Open ( vlc_object_t *p_this )
if( i_len >= 4 ) memcpy( psz_vobname + i_len - 4, ".sub", 4 );
/* open file */
p_sys->p_vobsub_stream = vlc_stream_NewMRL( p_demux, psz_vobname );
p_sys->p_vobsub_stream = vlc_stream_NewURL( p_demux, psz_vobname );
if( p_sys->p_vobsub_stream == NULL )
{
msg_Err( p_demux, "couldn't open .sub Vobsub file: %s",
......
......@@ -42,7 +42,7 @@ XMLParser::XMLParser( intf_thread_t *pIntf, const std::string &rFileName )
LoadCatalog();
char *psz_uri = vlc_path2uri( rFileName.c_str(), NULL );
m_pStream = vlc_stream_NewMRL( pIntf, psz_uri );
m_pStream = vlc_stream_NewURL( pIntf, psz_uri );
free( psz_uri );
if( !m_pStream )
{
......
......@@ -84,7 +84,7 @@ static int vlclua_stream_new( lua_State *L )
{
vlc_object_t * p_this = vlclua_get_this( L );
const char * psz_url = luaL_checkstring( L, 1 );
stream_t *p_stream = vlc_stream_NewMRL( p_this, psz_url );
stream_t *p_stream = vlc_stream_NewURL( p_this, psz_url );
/* XXX: For hysterical raisins, append one inflate decompression stream
* filter automatically (if applicable). */
......
......@@ -770,7 +770,7 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *curi )
free( uri );
return ret;
}
stream_t *s = vlc_stream_NewMRL( p_this, uri );
stream_t *s = vlc_stream_NewURL( p_this, uri );
if( !s )
{
free( uri );
......
......@@ -225,7 +225,7 @@ static int ListSkins( addons_finder_t *p_finder )
int i_ret;
char *psz_name = NULL;
char *psz_source = NULL;
stream_t *p_stream = vlc_stream_NewMRL( p_finder, psz_uri );
stream_t *p_stream = vlc_stream_NewURL( p_finder, psz_uri );
free( psz_uri );
if ( !p_stream )
{
......@@ -382,7 +382,7 @@ static int InstallFile( addons_storage_t *p_this, const char *psz_downloadlink,
char buffer[1<<10];
int i_read = 0;
p_stream = vlc_stream_NewMRL( p_this, psz_downloadlink );
p_stream = vlc_stream_NewURL( p_this, psz_downloadlink );
if( !p_stream )
{
msg_Err( p_this, "Failed to access Addon download url %s", psz_downloadlink );
......@@ -701,7 +701,7 @@ static int LoadCatalog( addons_finder_t *p_finder )
if ( !psz_catalog_uri )
return VLC_EGENERIC;
stream_t *p_stream = vlc_stream_NewMRL( p_finder, psz_catalog_uri );
stream_t *p_stream = vlc_stream_NewURL( p_finder, psz_catalog_uri );
free( psz_catalog_uri );
if (! p_stream ) return VLC_EGENERIC;
......
......@@ -329,7 +329,7 @@ static int Find( addons_finder_t *p_finder )
if ( ! asprintf( &psz_uri, ADDONS_REPO_SCHEMEHOST"/xml" ) ) return VLC_ENOMEM;
b_done = true;
stream_t *p_stream = vlc_stream_NewMRL( p_finder, psz_uri );
stream_t *p_stream = vlc_stream_NewURL( p_finder, psz_uri );
free( psz_uri );
if ( !p_stream ) return VLC_EGENERIC;
......@@ -370,12 +370,12 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry )
free( psz_archive_uri );
return VLC_ENOMEM;
}
p_stream = vlc_stream_NewMRL( p_finder, psz_uri );
p_stream = vlc_stream_NewURL( p_finder, psz_uri );
free( psz_uri );
}
else
{
p_stream = vlc_stream_NewMRL( p_finder, psz_archive_uri );
p_stream = vlc_stream_NewURL( p_finder, psz_archive_uri );
}
msg_Dbg( p_finder, "downloading archive %s", psz_archive_uri );
......@@ -434,7 +434,7 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry )
return VLC_ENOMEM;
}
p_stream = vlc_stream_NewMRL( p_finder, psz_manifest_uri );
p_stream = vlc_stream_NewURL( p_finder, psz_manifest_uri );
free( psz_manifest_uri );
if ( !p_stream )
{
......@@ -461,7 +461,7 @@ static int FindDesignated( addons_finder_t *p_finder )
psz_path ) < 1 )
return VLC_ENOMEM;
stream_t *p_stream = vlc_stream_NewMRL( p_finder, psz_manifest );
stream_t *p_stream = vlc_stream_NewURL( p_finder, psz_manifest );
free( psz_manifest );
if ( !p_stream ) return VLC_EGENERIC;
......
......@@ -535,7 +535,7 @@ static int Handshake(intf_thread_t *p_this)
return VLC_ENOMEM;
/* send the http handshake request */
p_stream = vlc_stream_NewMRL(p_intf, psz_handshake_url);
p_stream = vlc_stream_NewURL(p_intf, psz_handshake_url);
free(psz_handshake_url);
if (!p_stream)
......
......@@ -165,7 +165,7 @@ int DoAcoustIdWebRequest( vlc_object_t *p_obj, acoustid_fingerprint_t *p_data )
int i_saved_flags = p_obj->obj.flags;
p_obj->obj.flags |= OBJECT_FLAGS_NOINTERACT;
stream_t *p_stream = vlc_stream_NewMRL( p_obj, psz_url );
stream_t *p_stream = vlc_stream_NewURL( p_obj, psz_url );
free( psz_url );
p_obj->obj.flags = i_saved_flags;
......
......@@ -920,7 +920,7 @@ static rss_feed_t* FetchRSS( filter_t *p_filter )
/* Fetch the feed */
msg_Dbg( p_filter, "opening %s RSS/Atom feed ...", p_feed->psz_url );
p_stream = vlc_stream_NewMRL( p_filter, p_feed->psz_url );
p_stream = vlc_stream_NewURL( p_filter, p_feed->psz_url );
if( !p_stream )
{
msg_Err( p_filter, "Failed to open %s for reading", p_feed->psz_url );
......
......@@ -65,7 +65,7 @@ vlc_module_begin ()
add_submodule ()
set_description (N_("Burrows-Wheeler decompression"))
set_callbacks (OpenBzip2, Close)
/* TODO: access shortnames for vlc_stream_NewMRL() */
/* TODO: access shortnames for vlc_stream_NewURL() */
add_submodule ()
set_description (N_("gzip decompression"))
......
......@@ -799,7 +799,7 @@ static uint8_t* download_chunk( stream_t *s,
msg_Info(s, "Downloading fragment %s", fragment_url );
stream_t* download_stream = vlc_stream_NewMRL( s, fragment_url );
stream_t* download_stream = vlc_stream_NewURL( s, fragment_url );
if( ! download_stream )
{
msg_Err(s, "Failed to download fragment %s", fragment_url );
......@@ -1136,7 +1136,7 @@ static void* live_thread( void* p )
while( ! sys->closed )
{
last_dl_start_time = mdate();
stream_t* download_stream = vlc_stream_NewMRL( p_this, abst_url );
stream_t* download_stream = vlc_stream_NewURL( p_this, abst_url );
if( ! download_stream )
{
msg_Err( p_this, "Failed to download abst %s", abst_url );
......
......@@ -201,7 +201,7 @@ static int Android_ParseFamily( filter_t *p_filter, xml_reader_t *p_xml )
static int Android_ParseSystemFonts( filter_t *p_filter, const char *psz_path )
{
int i_ret = VLC_SUCCESS;
stream_t *p_stream = vlc_stream_NewMRL( p_filter, psz_path );
stream_t *p_stream = vlc_stream_NewURL( p_filter, psz_path );
if( !p_stream )
return VLC_EGENERIC;
......
......@@ -122,7 +122,7 @@ void vlc_stream_Delete(stream_t *s)
stream_CommonDelete(s);
}
stream_t *(vlc_stream_NewMRL)(vlc_object_t *p_parent, const char *psz_url)
stream_t *(vlc_stream_NewURL)(vlc_object_t *p_parent, const char *psz_url)
{
if( !psz_url )
return NULL;
......
......@@ -408,7 +408,7 @@ vlc_stream_ReadLine
vlc_stream_ReadPartial
vlc_stream_Seek
vlc_stream_Tell
vlc_stream_NewMRL
vlc_stream_NewURL
vlc_stream_vaControl
vlc_stream_ReadDir
vlc_stream_FilterDefaultReadDir
......
......@@ -235,7 +235,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
stream_t *p_stream = NULL;
uint64_t i_size;
p_stream = vlc_stream_NewMRL( p_image->p_parent, psz_url );
p_stream = vlc_stream_NewURL( p_image->p_parent, psz_url );
if( !p_stream )
{
......
......@@ -188,7 +188,7 @@ static bool GetUpdateFile( update_t *p_update )
char *psz_version_line = NULL;
char *psz_update_data = NULL;
p_stream = vlc_stream_NewMRL( p_update->p_libvlc, UPDATE_VLC_STATUS_URL );
p_stream = vlc_stream_NewURL( p_update->p_libvlc, UPDATE_VLC_STATUS_URL );
if( !p_stream )
{
msg_Err( p_update->p_libvlc, "Failed to open %s for reading",
......@@ -552,7 +552,7 @@ static void* update_DownloadReal( void *obj )
canc = vlc_savecancel ();
/* Open the stream */
p_stream = vlc_stream_NewMRL( p_udt, p_update->release.psz_url );
p_stream = vlc_stream_NewURL( p_udt, p_update->release.psz_url );
if( !p_stream )
{
msg_Err( p_udt, "Failed to open %s for reading", p_update->release.psz_url );
......
......@@ -937,7 +937,7 @@ public_key_t *download_key( vlc_object_t *p_this,
p_longid[4], p_longid[5], p_longid[6], p_longid[7] ) == -1 )
return NULL;
stream_t *p_stream = vlc_stream_NewMRL( p_this, psz_url );
stream_t *p_stream = vlc_stream_NewURL( p_this, psz_url );
free( psz_url );
if( !p_stream )
return NULL;
......@@ -1003,7 +1003,7 @@ int download_signature( vlc_object_t *p_this, signature_packet_t *p_sig,
strcpy( psz_sig, psz_url );
strcat( psz_sig, ".asc" );
stream_t *p_stream = vlc_stream_NewMRL( p_this, psz_sig );
stream_t *p_stream = vlc_stream_NewURL( p_this, psz_sig );
free( psz_sig );
if( !p_stream )
......
......@@ -377,7 +377,7 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
goto error;
}
stream_t *p_stream = vlc_stream_NewMRL( p_fetcher->object, psz_arturl );
stream_t *p_stream = vlc_stream_NewURL( p_fetcher->object, psz_arturl );
if( !p_stream )
goto error;
......
......@@ -202,7 +202,7 @@ stream_open( const char *psz_url )
p_vlc = libvlc_new( sizeof(argv) / sizeof(argv[0]), argv );
assert( p_vlc != NULL );
p_reader->u.s = vlc_stream_NewMRL( p_vlc->p_libvlc_int, psz_url );
p_reader->u.s = vlc_stream_NewURL( p_vlc->p_libvlc_int, psz_url );
if( !p_reader->u.s )
{
libvlc_release( p_vlc );
......
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