[vlc-devel] [PATCH 4/7] taglib: Always use IOStream to read the media
Thomas Guillem
thomas at gllm.fr
Mon Oct 7 09:26:34 CEST 2019
You are switching to vlc_stream_NewURL() which is nice since taglib will benefit now from our cache.
But this should be done in a separate commit.
And also, if you do that, you should disable the "prefetch" cache when 'preparsing' is true from stream_AccessNew() in src/input/access.c. Indeed, you don't want to prefetch the whole file while just preparsing.
On Fri, Oct 4, 2019, at 12:00, Hugo Beauzée-Luyssen wrote:
> ---
> modules/meta_engine/taglib.cpp | 33 ++++++---------------------------
> 1 file changed, 6 insertions(+), 27 deletions(-)
>
> diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
> index 8f3299b8f6..1e7da4791c 100644
> --- a/modules/meta_engine/taglib.cpp
> +++ b/modules/meta_engine/taglib.cpp
> @@ -832,40 +832,19 @@ static int ReadMeta( vlc_object_t* p_this)
> if( unlikely(psz_uri == NULL) )
> return VLC_ENOMEM;
>
> -#if VLC_WINSTORE_APP
> - stream_t *p_stream = vlc_access_NewMRL( p_this, psz_uri );
> - free( psz_uri );
> - if( p_stream == NULL )
> - return VLC_EGENERIC;
> -
> - VlcIostream s( p_stream );
> - f = FileRef( &s );
> -#else /* VLC_WINSTORE_APP */
> - char *psz_path = vlc_uri2path( psz_uri );
> - free( psz_uri );
> - if( psz_path == NULL )
> - return VLC_EGENERIC;
> -
> if( !b_extensions_registered )
> {
> FileRef::addFileTypeResolver( &aacresolver );
> b_extensions_registered = true;
> }
>
> -#if defined(_WIN32)
> - wchar_t *wpath = ToWide( psz_path );
> - if( wpath == NULL )
> - {
> - free( psz_path );
> + stream_t *p_stream = vlc_stream_NewURL( p_this, psz_uri );
> + free( psz_uri );
> + if( p_stream == NULL )
> return VLC_EGENERIC;
> - }
> - f = FileRef( wpath );
> - free( wpath );
> -#else
> - f = FileRef( psz_path );
> -#endif
> - free( psz_path );
> -#endif /* VLC_WINSTORE_APP */
> +
> + VlcIostream s( p_stream );
> + f = FileRef( &s );
>
> if( f.isNull() )
> return VLC_EGENERIC;
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list