[vlc-devel] [PATCH 4/7] taglib: Always use IOStream to read the media

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Oct 8 17:13:08 CEST 2019


Hi,

On Mon, Oct 7, 2019, at 9:26 AM, Thomas Guillem wrote:
> You are switching to vlc_stream_NewURL() which is nice since taglib 
> will benefit now from our cache.
> 

Actually, that's my bad, this change is wrong. Using NewURL instead of NewMRL might trigger the use of the skiptags stream filter, which definitely impedes on taglib's job. 

> 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.
> 

Or we can reject the skiptags filter when preparsing, and do the same for prefetch. That might be a better solution than sticking to vlc_stream_NewMRL

> 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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list