summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-31 16:40:11 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-31 16:40:11 +0200
commitcc8b7859c5d6f89db65361aeaea147ca3aeed7c1 (patch)
treea3e6c2e920f147b7eddcea32eeb18c8c919eb76b /plugins
parent6ea0f61e30e6ce8d75556f1af9da20ebc13f0eb0 (diff)
flac: after ignoring a bad FLAC__METADATA_TYPE_CUESHEET, don't give up, but try to load CUE from other sources
Diffstat (limited to 'plugins')
-rw-r--r--plugins/flac/flac.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c
index 40744ff6..e30cf848 100644
--- a/plugins/flac/flac.c
+++ b/plugins/flac/flac.c
@@ -627,7 +627,7 @@ cflac_insert_with_embedded_cue (ddb_playlist_t *plt, DB_playItem_t *after, DB_pl
// first check if cuesheet is matching the data
for (int i = 0; i < cuesheet->num_tracks; i++) {
if (cuesheet->tracks[i].offset >= totalsamples) {
- fprintf (stderr, "The flac %s has invalid embedded cuesheet. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI"));
+ fprintf (stderr, "The flac %s has invalid FLAC__METADATA_TYPE_CUESHEET block, which will get ignored. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI"));
return NULL;
}
}
@@ -842,17 +842,15 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
return cue;
}
}
- else {
- const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet");
- if (cuesheet) {
- DB_playItem_t *last = deadbeef->plt_insert_cue_from_buffer (plt, after, it, (const uint8_t *)cuesheet, strlen (cuesheet), info.totalsamples, info.info.fmt.samplerate);
- if (last) {
- cflac_free_temp (_info);
- deadbeef->pl_item_unref (it);
- deadbeef->pl_item_unref (last);
- deadbeef->pl_unlock ();
- return last;
- }
+ const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet");
+ if (cuesheet) {
+ DB_playItem_t *last = deadbeef->plt_insert_cue_from_buffer (plt, after, it, (const uint8_t *)cuesheet, strlen (cuesheet), info.totalsamples, info.info.fmt.samplerate);
+ if (last) {
+ cflac_free_temp (_info);
+ deadbeef->pl_item_unref (it);
+ deadbeef->pl_item_unref (last);
+ deadbeef->pl_unlock ();
+ return last;
}
}
deadbeef->pl_unlock ();