From 4a839537f259a82fb9988671ef9ef7c5488b5dc6 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Fri, 19 May 2006 05:37:05 +0000 Subject: [PATCH] use flac file name instead of dummy.wav for --export-cuesheet-to (sf request #1272825 https://sourceforge.net/tracker/index.php?func=detail&aid=1272825&group_id=13478&atid=363478) --- src/metaflac/operations_shorthand_cuesheet.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index 4f4a165..a4d11a0 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -170,6 +170,8 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cuesheet, const char *cs_filename) { FILE *f; + char *ref = 0; + size_t reflen; if(0 == cs_filename || strlen(cs_filename) == 0) { fprintf(stderr, "%s: ERROR: empty export file name\n", filename); @@ -185,7 +187,17 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe return false; } - grabbag__cuesheet_emit(f, cuesheet, "\"dummy.wav\" WAVE"); + reflen = strlen(filename) + 7 + 1; + if(0 == (ref = malloc(reflen))) { + fprintf(stderr, "%s: ERROR: allocating memory\n", filename); + return false; + } + + snprintf(ref, reflen, "\"%s\" FLAC", filename); + + grabbag__cuesheet_emit(f, cuesheet, ref); + + free(ref); if(f != stdout) fclose(f); -- 2.7.4