[vlc-devel] commit: Improved CDDB information support in cdda.c (Laurent Aimar )

git version control git at videolan.org
Sun Feb 1 15:05:13 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Feb  1 14:45:28 2009 +0100| [5ede35cb7b65f61558c00d2527afd5f0e9586e65] | committer: Laurent Aimar 

Improved CDDB information support in cdda.c

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

 modules/access/cdda.c          |   20 ++++++++++++++++++++
 modules/meta_engine/taglib.cpp |    2 +-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index 6748651..fb6a714 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -457,8 +457,28 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
                 if( psz_artist )
                     input_item_SetArtist( p_input_item, psz_artist );
             }
+
+            const char *psz_album = cddb_disc_get_title( p_sys->p_disc );
+            if( psz_album && *psz_album )
+                input_item_SetAlbum( p_input_item, psz_album );
+
+            const unsigned i_year = cddb_disc_get_year( p_sys->p_disc );
+            if( i_year > 0 )
+            {
+                char psz_date[4+1];
+                snprintf( psz_date, sizeof(psz_date), "%u", i_year );
+                input_item_SetDate( p_input_item, psz_date );
+            }
+
+            const char *psz_genre = cddb_disc_get_genre( p_sys->p_disc );
+            if( psz_genre && *psz_genre )
+                input_item_SetGenre( p_input_item, psz_genre );
         }
 #endif
+        char psz_num[3+1];
+        snprintf( psz_num, sizeof(psz_num), "%d", 1+i );
+        input_item_SetTrackNum( p_input_item, psz_num );
+
         input_item_AddSubItem( p_current, p_input_item );
         vlc_gc_decref( p_input_item );
         free( psz_uri ); free( psz_opt ); free( psz_name );
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 60b4a94..0a62e66 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -366,7 +366,7 @@ static int ReadMeta( vlc_object_t* p_this)
     SET( comment, Description );
     SET( genre, Genre );
     SETINT( year, Date );
-    SETINT( track, Tracknum );
+    SETINT( track, TrackNum );
 
 #undef SETINT
 #undef SET




More information about the vlc-devel mailing list