[vlc-devel] commit: taglib: change just a bit the code. ( Rémi Duraffort )

git version control git at videolan.org
Mon Jan 19 21:28:22 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jan 19 21:27:31 2009 +0100| [a02b83a7477ed76d26451b14bc4ecc50ea9e21b0] | committer: Rémi Duraffort 

taglib: change just a bit the code.

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

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

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index b2fd806..bab3414 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -131,15 +131,9 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
              * but in our case it will be a '\0'
              * terminated string */
             char psz_ufid[64];
-            int j = 0;
-            int max_size = p_ufid->identifier().size() < 63 ?
-                           p_ufid->identifier().size() : 63;
-            while( j < max_size )
-            {
-                psz_ufid[j] = p_ufid->identifier()[j];
-                j++;
-            }
-            psz_ufid[j] = '\0';
+            int max_size = __MIN( p_ufid->identifier().size(), 63);
+            strncmp( psz_ufid, p_ufid->identifier().data(), max_size );
+            psz_ufid[max_size] = '\0';
             vlc_meta_SetTrackID( p_meta, psz_ufid );
         }
     }




More information about the vlc-devel mailing list