summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flac/main.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/flac/main.c b/src/flac/main.c
index e36d8630..be072a3d 100644
--- a/src/flac/main.c
+++ b/src/flac/main.c
@@ -2173,12 +2173,30 @@ int decode_file(const char *infilename)
const char *get_encoded_outfilename(const char *infilename)
{
const char *suffix = (option_values.use_ogg? ".oga" : ".flac");
- return get_outfilename(infilename, suffix);
+ const char *p;
+
+ if(option_values.output_prefix) {
+ p = grabbag__file_get_basename(infilename);
+ }
+ else {
+ p = infilename;
+ }
+
+ return get_outfilename(p, suffix);
}
const char *get_decoded_outfilename(const char *infilename)
{
const char *suffix;
+ const char *p;
+
+ if(option_values.output_prefix) {
+ p = grabbag__file_get_basename(infilename);
+ }
+ else {
+ p = infilename;
+ }
+
if(option_values.analyze) {
suffix = ".ana";
}
@@ -2197,7 +2215,7 @@ const char *get_decoded_outfilename(const char *infilename)
else {
suffix = ".wav";
}
- return get_outfilename(infilename, suffix);
+ return get_outfilename(p, suffix);
}
const char *get_outfilename(const char *infilename, const char *suffix)