Changes for libcddb 1.1.0 API change.
Thanks to Chris Clayton for the patch.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cdda-player.c,v 1.34 2005/04/22 01:54:13 rocky Exp $
|
$Id: cdda-player.c,v 1.35 2005/07/09 15:22:44 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -381,12 +381,6 @@ read_subchannel(CdIo_t *p_cdio)
|
|||||||
return b_ok;
|
return b_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define add_cddb_disc_info(format_str, field) \
|
|
||||||
if (p_cddb_disc->field && !strlen(field)) { \
|
|
||||||
snprintf(field, sizeof(field), format_str, p_cddb_disc->field); \
|
|
||||||
b_cdtext_ ## field = false; \
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_cddb_disc_info(CdIo_t *p_cdio)
|
get_cddb_disc_info(CdIo_t *p_cdio)
|
||||||
{
|
{
|
||||||
@@ -394,10 +388,12 @@ get_cddb_disc_info(CdIo_t *p_cdio)
|
|||||||
b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track,
|
b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track,
|
||||||
i_tracks, &i_cddb_matches);
|
i_tracks, &i_cddb_matches);
|
||||||
if (b_db) {
|
if (b_db) {
|
||||||
add_cddb_disc_info("%s", artist);
|
int i_year;
|
||||||
add_cddb_disc_info("%s", title);
|
i_year = atoi(year);
|
||||||
add_cddb_disc_info("%s", genre);
|
cddb_disc_set_artist(p_cddb_disc, artist);
|
||||||
add_cddb_disc_info("%4d", year);
|
cddb_disc_set_title(p_cddb_disc, title);
|
||||||
|
cddb_disc_set_genre(p_cddb_disc, genre);
|
||||||
|
cddb_disc_set_year(p_cddb_disc, i_year);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
@@ -687,11 +683,6 @@ display_status(bool b_status_only)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define add_cddb_track_info(format_str, field) \
|
|
||||||
if (t->field) \
|
|
||||||
snprintf(cd_info[i_track].field, sizeof(cd_info[i_track].field)-1, \
|
|
||||||
format_str, t->field);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_cddb_track_info(track_t i_track)
|
get_cddb_track_info(track_t i_track)
|
||||||
{
|
{
|
||||||
@@ -699,8 +690,8 @@ get_cddb_track_info(track_t i_track)
|
|||||||
cddb_track_t *t = cddb_disc_get_track(p_cddb_disc,
|
cddb_track_t *t = cddb_disc_get_track(p_cddb_disc,
|
||||||
i_track - i_first_track);
|
i_track - i_first_track);
|
||||||
if (t) {
|
if (t) {
|
||||||
add_cddb_track_info("%s", title);
|
cddb_track_set_title(t, title);
|
||||||
add_cddb_track_info("%s", artist);
|
cddb_track_set_artist(t, artist);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
11
src/cddb.c
11
src/cddb.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cddb.c,v 1.3 2005/03/12 06:02:36 rocky Exp $
|
$Id: cddb.c,v 1.4 2005/07/09 15:22:44 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -117,13 +117,14 @@ init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn, cddb_disc_t **pp_cddb_disc,
|
|||||||
}
|
}
|
||||||
for(i = 0; i < i_tracks; i++) {
|
for(i = 0; i < i_tracks; i++) {
|
||||||
cddb_track_t *t = cddb_track_new();
|
cddb_track_t *t = cddb_track_new();
|
||||||
t->frame_offset = cdio_get_track_lba(p_cdio, i+i_first_track);
|
cddb_track_set_frame_offset(t,
|
||||||
|
cdio_get_track_lba(p_cdio, i+i_first_track));
|
||||||
cddb_disc_add_track(*pp_cddb_disc, t);
|
cddb_disc_add_track(*pp_cddb_disc, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pp_cddb_disc)->length =
|
cddb_disc_set_length(*pp_cddb_disc,
|
||||||
cdio_get_track_lba(p_cdio, CDIO_CDROM_LEADOUT_TRACK)
|
cdio_get_track_lba(p_cdio, CDIO_CDROM_LEADOUT_TRACK)
|
||||||
/ CDIO_CD_FRAMES_PER_SEC;
|
/ CDIO_CD_FRAMES_PER_SEC);
|
||||||
|
|
||||||
if (!cddb_disc_calc_discid(*pp_cddb_disc)) {
|
if (!cddb_disc_calc_discid(*pp_cddb_disc)) {
|
||||||
errmsg("libcddb calc discid failed.");
|
errmsg("libcddb calc discid failed.");
|
||||||
|
|||||||
Reference in New Issue
Block a user