[vlc-devel] commit: itml: factorize and add missing #undef. ( Rémi Duraffort )

git version control git at videolan.org
Wed Jul 15 14:41:33 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 15 14:27:45 2009 +0200| [918a6962f2223294a8818ef2c58fcc6d6f367528] | committer: Rémi Duraffort 

itml: factorize and add missing #undef.

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

 modules/demux/playlist/itml.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 3592f98..19108f0 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -451,6 +451,7 @@ static bool save_data SIMPLE_INTERFACE
         long i_num = atol( psz_value );
         p_track->duration = (mtime_t) i_num*1000;
     }
+#undef SAVE_INFO
     return true;
 }
 
@@ -464,15 +465,15 @@ static bool add_meta( input_item_t *p_input_item,
     if( !p_input_item || !p_track )
         return false;
 
-#define SET_INFO( func, prop ) \
-    if( p_track->prop ) { func( p_input_item, p_track->prop ); }
-
-    SET_INFO( input_item_SetTitle, name )
-    SET_INFO( input_item_SetArtist, artist )
-    SET_INFO( input_item_SetAlbum, album )
-    SET_INFO( input_item_SetGenre, genre )
-    SET_INFO( input_item_SetTrackNum, trackNum )
-    SET_INFO( input_item_SetDuration, duration )
+#define SET_INFO( type, prop ) \
+    if( p_track->prop ) {input_item_Set##type( p_input_item, p_track->prop );}
+    SET_INFO( Title, name )
+    SET_INFO( Artist, artist )
+    SET_INFO( Album, album )
+    SET_INFO( Genre, genre )
+    SET_INFO( TrackNum, trackNum )
+    SET_INFO( Duration, duration )
+#undef SET_INFO
     return true;
 }
 




More information about the vlc-devel mailing list