Commit 7df7aab9 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fixes for CDDB courtesy of Alexander Gall <gall at switch dot ch>.

 - added him to THANKS as well.
parent 1571b679
...@@ -9,6 +9,7 @@ Michel Lespinasse <walken at zoy.org> - AC3 decoder, MPEG audio and video decode ...@@ -9,6 +9,7 @@ Michel Lespinasse <walken at zoy.org> - AC3 decoder, MPEG audio and video decode
The VideoLAN team would like to thank the following contributors: The VideoLAN team would like to thank the following contributors:
Alexander Didebulidze <alexander.didebulidze at stusta dot mhn dot de> - Georgian localization Alexander Didebulidze <alexander.didebulidze at stusta dot mhn dot de> - Georgian localization
Alexander Gall <gall at switch dot ch> - Solaris fixes and CDDB fixes
Alex Izvorski <aizvorski at gmail dot com> - some more x264 options Alex Izvorski <aizvorski at gmail dot com> - some more x264 options
André de Barros Martins Ribeiro <andrerib at ajato.com.br> - Brazilian portuguese localization André de Barros Martins Ribeiro <andrerib at ajato.com.br> - Brazilian portuguese localization
Andre Pang <adre.pang at csiro dot au> - Annodex support Andre Pang <adre.pang at csiro dot au> - Annodex support
......
...@@ -163,13 +163,13 @@ cddb_end: ; ...@@ -163,13 +163,13 @@ cddb_end: ;
} \ } \
#define add_cddb_meta(FIELD, VLC_META) \ #define add_cddb_meta(FIELD, VLC_META) \
add_meta_val(VLC_META, p_cdda->cddb.disc->FIELD); add_meta_val(VLC_META, cddb_disc_get_##FIELD(p_cdda->cddb.disc));
#define add_cddb_meta_fmt(FIELD, FORMAT_SPEC, VLC_META) \ #define add_cddb_meta_fmt(FIELD, FORMAT_SPEC, VLC_META) \
{ \ { \
char psz_buf[100]; \ char psz_buf[100]; \
snprintf( psz_buf, sizeof(psz_buf)-1, FORMAT_SPEC, \ snprintf( psz_buf, sizeof(psz_buf)-1, FORMAT_SPEC, \
p_cdda->cddb.disc->FIELD ); \ cddb_disc_get_##FIELD(p_cdda->cddb.disc)); \
psz_buf[sizeof(psz_buf)-1] = '\0'; \ psz_buf[sizeof(psz_buf)-1] = '\0'; \
add_meta_val(VLC_META, psz_buf); \ add_meta_val(VLC_META, psz_buf); \
} }
...@@ -195,13 +195,13 @@ cddb_end: ; ...@@ -195,13 +195,13 @@ cddb_end: ;
under category "Disc" if the string is not null or the null string. under category "Disc" if the string is not null or the null string.
*/ */
#define add_cddb_disc_info_str(TITLE, FIELD) \ #define add_cddb_disc_info_str(TITLE, FIELD) \
add_info_str("Disc", TITLE, p_cdda->cddb.disc->FIELD) add_info_str("Disc", TITLE, cddb_disc_get_##FIELD(p_cdda->cddb.disc))
/* Adds a CDDB numeric-valued entry to the stream and media information /* Adds a CDDB numeric-valued entry to the stream and media information
under category "Disc" if the string is not null or the null string. under category "Disc" if the string is not null or the null string.
*/ */
#define add_cddb_disc_info_val(TITLE, FMT, FIELD) \ #define add_cddb_disc_info_val(TITLE, FMT, FIELD) \
add_info_val("Disc", TITLE, FMT, p_cdda->cddb.disc->FIELD) add_info_val("Disc", TITLE, FMT, cddb_disc_get_##FIELD(p_cdda->cddb.disc))
/* Adds a CD-Text string-valued entry to the stream and media information /* Adds a CD-Text string-valued entry to the stream and media information
under category "Disc" if the string is not null or the null string. under category "Disc" if the string is not null or the null string.
...@@ -283,11 +283,12 @@ CDDAMetaInfo( access_t *p_access, track_t i_track ) ...@@ -283,11 +283,12 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
if( CDIO_INVALID_TRACK == i_track ) if( CDIO_INVALID_TRACK == i_track )
{ {
psz_meta_title = p_cdda->cddb.disc->title; psz_meta_title = (char *)cddb_disc_get_title(p_cdda->cddb.disc);
psz_meta_artist = p_cdda->cddb.disc->artist; psz_meta_artist = (char *)cddb_disc_get_artist(p_cdda->cddb.disc);
if ( p_cdda->cddb.disc->genre && strlen(p_cdda->cddb.disc->genre) ) if ( cddb_disc_get_genre(p_cdda->cddb.disc) &&
strlen(cddb_disc_get_genre(p_cdda->cddb.disc)) )
add_cddb_meta(genre, VLC_META_GENRE); add_cddb_meta(genre, VLC_META_GENRE);
if ( 0 != p_cdda->cddb.disc->year ) if ( 0 != cddb_disc_get_year(p_cdda->cddb.disc))
add_cddb_meta_fmt(year, "%d", VLC_META_DATE ); add_cddb_meta_fmt(year, "%d", VLC_META_DATE );
} }
else else
...@@ -295,13 +296,13 @@ CDDAMetaInfo( access_t *p_access, track_t i_track ) ...@@ -295,13 +296,13 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, i_track-1); cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, i_track-1);
if (t != NULL ) if (t != NULL )
{ {
if( t->title != NULL && ! p_cdda->b_nav_mode ) if( cddb_track_get_title(t) != NULL && ! p_cdda->b_nav_mode )
{ {
add_meta_val( VLC_META_TITLE, t->title ); add_meta_val( VLC_META_TITLE, cddb_track_get_title(t) );
} }
if( t->artist != NULL ) if( cddb_track_get_artist(t) != NULL )
{ {
add_meta_val( VLC_META_ARTIST, t->artist ); add_meta_val( VLC_META_ARTIST, cddb_track_get_artist(t) );
} }
} }
} }
...@@ -339,14 +340,14 @@ CDDAMetaInfo( access_t *p_access, track_t i_track ) ...@@ -339,14 +340,14 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
if (p_cdda->b_cddb_enabled && p_cdda->cddb.disc) if (p_cdda->b_cddb_enabled && p_cdda->cddb.disc)
{ {
add_cddb_disc_info_str("Artist (CDDB)", artist); add_cddb_disc_info_str("Artist (CDDB)", artist);
if ( CDDB_CAT_INVALID != p_cdda->cddb.disc->category ) if ( CDDB_CAT_INVALID != cddb_disc_get_category(p_cdda->cddb.disc) )
add_info_str("Disc", "Category (CDDB)", add_info_str("Disc", "Category (CDDB)",
CDDB_CATEGORY[p_cdda->cddb.disc->category]); CDDB_CATEGORY[cddb_disc_get_category(p_cdda->cddb.disc)]);
add_cddb_disc_info_val("Disc ID (CDDB)", "%x", discid); add_cddb_disc_info_val("Disc ID (CDDB)", "%x", discid);
add_cddb_disc_info_str("Extended Data (CDDB)", ext_data); add_cddb_disc_info_str("Extended Data (CDDB)", ext_data);
add_cddb_disc_info_str("Genre (CDDB)", genre); add_cddb_disc_info_str("Genre (CDDB)", genre);
add_cddb_disc_info_str("Title (CDDB)", title); add_cddb_disc_info_str("Title (CDDB)", title);
if ( 0 != p_cdda->cddb.disc->year ) if ( 0 != cddb_disc_get_year(p_cdda->cddb.disc) )
add_cddb_disc_info_val("Year (CDDB)", "%d", year); add_cddb_disc_info_val("Year (CDDB)", "%d", year);
} }
...@@ -423,10 +424,12 @@ CDDAMetaInfo( access_t *p_access, track_t i_track ) ...@@ -423,10 +424,12 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, i); cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, i);
if (t != NULL) if (t != NULL)
{ {
add_info_str(psz_track, "Artist (CDDB)", t->artist); add_info_str(psz_track, "Artist (CDDB)",
add_info_str(psz_track, "Title (CDDB)", t->title); cddb_track_get_artist(t));
add_info_str(psz_track, "Title (CDDB)",
cddb_track_get_title(t));
add_info_str(psz_track, "Extended Data (CDDB)", add_info_str(psz_track, "Extended Data (CDDB)",
t->ext_data); cddb_track_get_ext_data(t));
} }
} }
#endif /*HAVE_LIBCDDB*/ #endif /*HAVE_LIBCDDB*/
...@@ -566,41 +569,41 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, ...@@ -566,41 +569,41 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
&& p_cdda->p_cdtext[0]->field[CDTEXT_PERFORMER]) && p_cdda->p_cdtext[0]->field[CDTEXT_PERFORMER])
psz = p_cdda->p_cdtext[0]->field[CDTEXT_PERFORMER]; psz = p_cdda->p_cdtext[0]->field[CDTEXT_PERFORMER];
if (want_cddb_info(p_cdda, psz)) if (want_cddb_info(p_cdda, psz))
psz = p_cdda->cddb.disc->artist; psz = (char *)cddb_disc_get_artist(p_cdda->cddb.disc);
goto format_str; goto format_str;
case 'A': case 'A':
if (p_cdda->p_cdtext[0] if (p_cdda->p_cdtext[0]
&& p_cdda->p_cdtext[0]->field[CDTEXT_TITLE]) && p_cdda->p_cdtext[0]->field[CDTEXT_TITLE])
psz = p_cdda->p_cdtext[0]->field[CDTEXT_TITLE]; psz = p_cdda->p_cdtext[0]->field[CDTEXT_TITLE];
if (want_cddb_info(p_cdda, psz)) if (want_cddb_info(p_cdda, psz))
psz = p_cdda->cddb.disc->title; psz = (char *)cddb_disc_get_title(p_cdda->cddb.disc);
goto format_str; goto format_str;
case 'C': case 'C':
if (!p_cdda->b_cddb_enabled) goto not_special; if (!p_cdda->b_cddb_enabled) goto not_special;
if (p_cdda->cddb.disc) if (p_cdda->cddb.disc)
add_format_str_info( add_format_str_info(CDDB_CATEGORY[cddb_disc_get_category(p_cdda->cddb.disc)]);
CDDB_CATEGORY[p_cdda->cddb.disc->category]);
break; break;
case 'G': case 'G':
if (p_cdda->p_cdtext[0] if (p_cdda->p_cdtext[0]
&& p_cdda->p_cdtext[0]->field[CDTEXT_GENRE]) && p_cdda->p_cdtext[0]->field[CDTEXT_GENRE])
psz = p_cdda->p_cdtext[0]->field[CDTEXT_GENRE]; psz = p_cdda->p_cdtext[0]->field[CDTEXT_GENRE];
if (want_cddb_info(p_cdda, psz)) if (want_cddb_info(p_cdda, psz))
psz = p_cdda->cddb.disc->genre; psz = (char *)cddb_disc_get_genre(p_cdda->cddb.disc);
goto format_str; goto format_str;
case 'I': case 'I':
if (p_cdda->p_cdtext[0] if (p_cdda->p_cdtext[0]
&& p_cdda->p_cdtext[0]->field[CDTEXT_DISCID]) && p_cdda->p_cdtext[0]->field[CDTEXT_DISCID])
psz = p_cdda->p_cdtext[0]->field[CDTEXT_DISCID]; psz = p_cdda->p_cdtext[0]->field[CDTEXT_DISCID];
if (want_cddb_info(p_cdda, psz)) { if (want_cddb_info(p_cdda, psz)) {
add_format_num_info(p_cdda->cddb.disc->discid, "%x"); add_format_num_info(cddb_disc_get_discid(p_cdda->cddb.disc), "%x");
} else if (psz) } else if (psz)
add_format_str_info(psz); add_format_str_info(psz);
break; break;
case 'Y': case 'Y':
if (!p_cdda->b_cddb_enabled) goto not_special; if (!p_cdda->b_cddb_enabled) goto not_special;
if (p_cdda->cddb.disc) if (p_cdda->cddb.disc)
add_format_num_info(p_cdda->cddb.disc->year, "%5d"); add_format_num_info(cddb_disc_get_year(p_cdda->cddb.disc),
"%5d");
break; break;
case 't': case 't':
if ( CDIO_INVALID_TRACK == i_track ) break; if ( CDIO_INVALID_TRACK == i_track ) break;
...@@ -608,8 +611,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, ...@@ -608,8 +611,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
{ {
cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc,
i_track-1); i_track-1);
if (t != NULL && t->title != NULL) { if (t != NULL && cddb_track_get_title(t) != NULL) {
add_format_str_info(t->title); add_format_str_info(cddb_track_get_title(t));
} else { } else {
add_format_str_info(psz_mrl); add_format_str_info(psz_mrl);
} }
...@@ -631,8 +634,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, ...@@ -631,8 +634,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
{ {
cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc,
i_track-1); i_track-1);
if (t != NULL && t->artist != NULL) if (t != NULL && cddb_track_get_artist(t) != NULL)
psz = t->artist; psz = (char *)cddb_track_get_artist(t);
} }
goto format_str; goto format_str;
case 'e': case 'e':
...@@ -644,8 +647,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, ...@@ -644,8 +647,8 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
{ {
cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc,
i_track-1); i_track-1);
if (t != NULL && t->ext_data != NULL) if (t != NULL && cddb_track_get_ext_data(t) != NULL)
psz = t->ext_data; psz = (char *)cddb_track_get_ext_data(t);
} }
goto format_str; goto format_str;
break; break;
...@@ -884,15 +887,15 @@ int CDDAAddMetaToItem( access_t *p_access, cdda_data_t *p_cdda, ...@@ -884,15 +887,15 @@ int CDDAAddMetaToItem( access_t *p_access, cdda_data_t *p_cdda,
if (t) if (t)
{ {
if (t->artist) if (cddb_track_get_artist(t))
add_playlist_track_info_str("Artist (CDDB)", add_playlist_track_info_str("Artist (CDDB)",
t->artist); cddb_track_get_artist(t));
if (t->title) if (cddb_track_get_title(t))
add_playlist_track_info_str("Title (CDDB)", add_playlist_track_info_str("Title (CDDB)",
t->title); cddb_track_get_title(t));
if (t->ext_data) if (cddb_track_get_ext_data(t))
add_playlist_track_info_str("Extended information (CDDB)", add_playlist_track_info_str("Extended information (CDDB)",
t->ext_data); cddb_track_get_ext_data(t));
} }
} }
#endif /*HAVE_LIBCDDB*/ #endif /*HAVE_LIBCDDB*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment