[vlc-devel] commit: taglib: fix variable scoping (Derk-Jan Hartman )

git version control git at videolan.org
Mon Aug 18 01:02:18 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Aug 18 01:04:15 2008 +0200| [abcff2bd9243c8064ab289bf9138a4cb68e55e01] | committer: Derk-Jan Hartman 

taglib: fix variable scoping

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abcff2bd9243c8064ab289bf9138a4cb68e55e01
---

 modules/meta_engine/taglib.cpp |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 1845f6f..4441255 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -245,6 +245,7 @@ static int ReadMeta( vlc_object_t *p_this )
     demux_t         *p_demux = (demux_t *)p_this;
     demux_meta_t    *p_demux_meta = (demux_meta_t*)p_demux->p_private;
     vlc_meta_t      *p_meta;
+    TagLib::FileRef  f;
 
     TAB_INIT( p_demux_meta->i_attachments, p_demux_meta->attachments );
     p_demux_meta->p_meta = NULL;
@@ -254,22 +255,19 @@ static int ReadMeta( vlc_object_t *p_this )
     {
         wchar_t wpath[MAX_PATH + 1];
         if( !MultiByteToWideChar( CP_UTF8, 0, p_demux->psz_path, -1, wpath, MAX_PATH) )
-        {
-            errno = ENOENT;
             return VLC_EGENERIC;
-        }
+
         wpath[MAX_PATH] = L'0';
-        FileRef f( wpath );
+        f = FileRef( wpath );
     }
     else return VLC_EGENERIC;
 #else
     const char *local_name = ToLocale( p_demux->psz_path );
 
     if( local_name == NULL )
-    {
         return VLC_EGENERIC;
-    }
-    FileRef f( local_name );
+
+    f = FileRef( local_name );
     LocaleFree( local_name );
 #endif
 




More information about the vlc-devel mailing list