Commit 75c0a33e authored by Serge Ziryukin's avatar Serge Ziryukin Committed by Max Kellermann

flac: load external cue sheet when no internal one

External cue sheet file for "file.flac" should be named as "file.flac.cue".
parent 8ae9b45d
......@@ -9,6 +9,7 @@ ver 0.16 (20??/??/??)
* decoders:
- ffmpeg: support multiple tags
- sndfile: new decoder plugin based on libsndfile
- flac: load external cue sheet when no internal one
* mixers:
- removed support for legacy mixer configuration
- reimplemented software volume as mixer+filter plugin
......
......@@ -300,6 +300,8 @@ flac_cue_tag_load(const char *file)
FLAC__uint64 track_time = 0;
#ifdef HAVE_CUE /* libcue */
FLAC__StreamMetadata* vc = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
char* cs_filename;
FILE* cs_file;
#endif /* libcue */
FLAC__StreamMetadata* si = FLAC__metadata_object_new(FLAC__METADATA_TYPE_STREAMINFO);
FLAC__StreamMetadata* cs = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET);
......@@ -328,6 +330,18 @@ flac_cue_tag_load(const char *file)
}
FLAC__metadata_object_delete(vc);
}
if (tag == NULL) {
cs_filename = g_strconcat(file, ".cue", NULL);
cs_file = fopen(cs_filename, "rt");
g_free(cs_filename);
if (cs_file != NULL) {
tag = cue_tag_file(cs_file, tnum);
fclose(cs_file);
}
}
#endif /* libcue */
if (tag == NULL)
......
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