]> git.sesse.net Git - vlc/blobdiff - modules/meta_engine/taglib.cpp
Removes trailing spaces. Removes tabs.
[vlc] / modules / meta_engine / taglib.cpp
index fe92d411eeb6bf57d97e6ddaec498e6980feef10..1a90d580d39777aa0de16c6408775e549046e25a 100644 (file)
@@ -132,7 +132,7 @@ static int ReadMeta( vlc_object_t *p_this )
                 if (!strcmp( owner, "http://musicbrainz.org" ))
                 {
                     /* ID3v2 UFID contains up to 64 bytes binary data
-                        * but in our case it will be a '\0' 
+                        * but in our case it will be a '\0'
                         * terminated string */
                     char *psz_ufid = (char*) malloc( 64 );
                     int j = 0;
@@ -152,7 +152,7 @@ static int ReadMeta( vlc_object_t *p_this )
             {
                 p_txxx = dynamic_cast<TagLib::ID3v2::UserTextIdentificationFrame*>(*iter);
                 const char *psz_desc= p_txxx->description().toCString();
-                vlc_meta_AddExtra( p_meta, psz_desc, 
+                vlc_meta_AddExtra( p_meta, psz_desc,
                             p_txxx->fieldList().toString().toCString());
             }
 #if 0
@@ -199,14 +199,11 @@ vlc_meta_Set##bar( p_meta, p_t->toString().toCString(true))
         {
             input_item_t *p_item = input_GetItem( p_input );
             if( p_item )
-            {
-                vlc_mutex_lock( &p_item->lock );
-                p_item->i_duration = i_ogg_v_length * 1000000;
-                vlc_mutex_unlock( &p_item->lock );
-            }
+                input_item_SetDuration( p_item,
+                        (mtime_t) i_ogg_v_length * 1000000 );
             vlc_object_release( p_input );
         }
-        
     }
 #if 0 /* at this moment, taglib is unable to detect ogg/flac files
 * becauses type detection is based on file extension:
@@ -224,11 +221,8 @@ vlc_meta_Set##bar( p_meta, p_t->toString().toCString(true))
         {
             input_item_t *p_item = input_GetItem( p_input );
             if( p_item )
-            {
-                vlc_mutex_lock( &p_item->lock );
-                p_item->i_duration = i_ogg_f_length * 1000000;
-                vlc_mutex_unlock( &p_item->lock );
-            }
+                input_item_SetDuration( p_item,
+                        (mtime_t) i_ogg_f_length * 1000000 );
             vlc_object_release( p_input );
         }
     }
@@ -243,11 +237,8 @@ vlc_meta_Set##bar( p_meta, p_t->toString().toCString(true))
         {
             input_item_t *p_item = input_GetItem( p_input );
             if( p_item )
-            {
-                vlc_mutex_lock( &p_item->lock );
-                p_item->i_duration = i_flac_length * 1000000;
-                vlc_mutex_unlock( &p_item->lock );
-            }
+                input_item_SetDuration( p_item,
+                        (mtime_t) i_flac_length * 1000000 );
             vlc_object_release( p_input );
         }
     }
@@ -279,7 +270,7 @@ static int WriteMeta( vlc_object_t *p_this )
     playlist_t *p_playlist = (playlist_t *)p_this;
     meta_export_t *p_export = (meta_export_t *)p_playlist->p_private;
     input_item_t *p_item = p_export->p_item;
-    
     if( p_item == NULL )
     {
         msg_Err( p_this, "Can't save meta data of an empty input" );
@@ -350,14 +341,14 @@ static int WriteMeta( vlc_object_t *p_this )
             TagLib::ID3v2::TextIdentificationFrame p_frame( p_byte ); \
             p_frame.setText( psz_meta ); \
             p_id3tag->addFrame( &p_frame ); \
+            free( psz_meta ); \
         } \
-        else free( psz_meta );
 
         WRITE( Publisher, "TPUB" );
         WRITE( Copyright, "TCOP" );
         WRITE( EncodedBy, "TENC" );
         WRITE( Language, "TLAN" );
-        
 #undef WRITE
     }