[vlc-devel] commit: cdda: Avoid a macro and kill a warning. (Pierre d'Herbemont )
git version control
git at videolan.org
Thu Aug 20 18:38:28 CEST 2009
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Aug 20 18:10:14 2009 +0200| [7924facaaad33e2cf107a40cb8c81601038c0008] | committer: Pierre d'Herbemont
cdda: Avoid a macro and kill a warning.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7924facaaad33e2cf107a40cb8c81601038c0008
---
modules/access/cdda/info.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules/access/cdda/info.c b/modules/access/cdda/info.c
index 3485b41..1d7c36f 100644
--- a/modules/access/cdda/info.c
+++ b/modules/access/cdda/info.c
@@ -157,15 +157,15 @@ cddb_end: ;
}
#endif /*HAVE_LIBCDDB*/
-#define add_meta_val(VLC_META, VAL) \
- if ( p_cdda->p_meta && VAL) { \
- /*vlc_meta_Add( p_cdda->p_meta, VLC_META, VAL );*/ \
- dbg_print( INPUT_DBG_META, "field %s: %s\n", \
- input_MetaTypeToLocalizedString(VLC_META), VAL ); \
- } \
+static inline void add_meta_val(access_t *p_access, vlc_meta_type_t meta, const char * val)
+{
+ cdda_data_t *p_cdda = (cdda_data_t *)p_access->p_sys;
+ if (p_cdda->p_meta && val)
+ dbg_print( INPUT_DBG_META, "field %s: %s\n", input_MetaTypeToLocalizedString(meta), val);
+}
#define add_cddb_meta(FIELD, VLC_META) \
- add_meta_val(VLC_META, cddb_disc_get_##FIELD(p_cdda->cddb.disc));
+ add_meta_val(p_access, VLC_META, cddb_disc_get_##FIELD(p_cdda->cddb.disc));
#define add_cddb_meta_fmt(FIELD, FORMAT_SPEC, VLC_META) \
{ \
@@ -173,7 +173,7 @@ cddb_end: ;
snprintf( psz_buf, sizeof(psz_buf)-1, FORMAT_SPEC, \
cddb_disc_get_##FIELD(p_cdda->cddb.disc)); \
psz_buf[sizeof(psz_buf)-1] = '\0'; \
- add_meta_val(VLC_META, psz_buf); \
+ add_meta_val(p_access, VLC_META, psz_buf); \
}
/* Adds a string-valued entry to the stream and media information if
@@ -302,11 +302,11 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
{
if( cddb_track_get_title(t) != NULL && ! p_cdda->b_nav_mode )
{
- add_meta_val( vlc_meta_Title, cddb_track_get_title(t) );
+ add_meta_val( p_access, vlc_meta_Title, cddb_track_get_title(t) );
}
if( cddb_track_get_artist(t) != NULL )
{
- add_meta_val( vlc_meta_Artist, cddb_track_get_artist(t) );
+ add_meta_val( p_access, vlc_meta_Artist, cddb_track_get_artist(t) );
}
}
}
@@ -452,14 +452,14 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
{
char *psz_name = CDDAFormatTitle( p_access, i_track ) ;
if ( !p_cdda->b_nav_mode ) {
- add_meta_val( vlc_meta_Title, psz_name );
+ add_meta_val( p_access, vlc_meta_Title, psz_name );
} else
{
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_name );
free(psz_name);
}
if (psz_meta_artist)
- add_meta_val( vlc_meta_Artist, psz_meta_artist );
+ add_meta_val( p_access, vlc_meta_Artist, psz_meta_artist );
}
}
}
More information about the vlc-devel
mailing list