summaryrefslogtreecommitdiff
path: root/plugins/cdda
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-10-31 18:25:37 +0100
committerGravatar waker <wakeroid@gmail.com>2010-10-31 18:25:37 +0100
commit86c756deeb6effd9b29968a3649f8387c0b6d62a (patch)
tree1911e2d105628de793f6c913c60f052b1f4e0a5a /plugins/cdda
parent1165a25a0ac57d3bcaf29afc9a5537523d4b0a99 (diff)
parent6e99c2322741baf2bbe50c69c29a0ffe4f2c8d0c (diff)
Merge branch 'master' into static
Conflicts: configure.ac
Diffstat (limited to 'plugins/cdda')
-rw-r--r--plugins/cdda/cdda.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c
index f2e5066c..2ed54b51 100644
--- a/plugins/cdda/cdda.c
+++ b/plugins/cdda/cdda.c
@@ -362,6 +362,7 @@ cddb_thread (void *items_i)
deadbeef->mutex_unlock (mutex);
cleanup_thread_params (params);
cddb_tid = 0;
+ deadbeef->plug_trigger_event_playlistchanged ();
}
static void
@@ -384,15 +385,19 @@ read_track_cdtext (CdIo_t *cdio, int track_nr, DB_playItem_t *item)
{
switch (field_type)
{
- case CDTEXT_TITLE: album = strdup (text); break;
- case CDTEXT_PERFORMER: artist = strdup (text); break;
+ case CDTEXT_TITLE: album = text; break;
+ case CDTEXT_PERFORMER: artist = text; break;
}
}
}
trace ("artist: %s; album: %s\n", artist, album);
- deadbeef->pl_replace_meta (item, "artist", artist);
- deadbeef->pl_replace_meta (item, "album", album);
+ if (artist) {
+ deadbeef->pl_replace_meta (item, "artist", artist);
+ }
+ if (album) {
+ deadbeef->pl_replace_meta (item, "album", album);
+ }
cdtext = cdio_get_cdtext (cdio, track_nr);
if (!cdtext)
@@ -414,7 +419,7 @@ read_track_cdtext (CdIo_t *cdio, int track_nr, DB_playItem_t *item)
case CDTEXT_MESSAGE: field = "comment"; break;
default: field = NULL;
}
- if (field)
+ if (field && text)
{
trace ("%s: %s\n", field, text);
deadbeef->pl_replace_meta (item, field, text);
@@ -521,7 +526,6 @@ cda_insert (DB_playItem_t *after, const char *fname) {
}
cdio_destroy (cdio);
}
- deadbeef->plug_trigger_event_playlistchanged ();
return res;
}