[Flac-dev] Proposed change to code that handles output_prefix

Justin Akehurst akehurst at poindextrose.org
Tue Aug 20 10:06:03 PDT 2002


On Tue, 20 Aug 2002, Josh Coalson wrote:

> --- Justin Akehurst <akehurst at poindextrose.org> wrote:
> > 
> > On line 734 in src/flac/main.c, ver 1.77, change:
> > 
> > strcat(outfilename, infilename);
> > 
> > to
> > 
> > strcat(outfilename, flac__file_get_basename(infilename));
> > 
> > I did this change because I was calling flac with an input filename
> > with a
> > path on the front of it, and I wanted the output file to go to a
> > different
> > location, such as this:
> > 
> > flac --best --output-prefix /usr/share/flac
> > /home/akehurst/tmp/my_file.wav
> > 
> > before the change, it was just concatenating the input filename to
> > the
> > output prefix.
> 
> The reason it is like that is so that you can preserve the
> hierarchy of the input directory.  e.g.
> 
>   flac --output-prefix=/a/b/ x/1.wav y/2.wav
> 
> will give you /a/b/x/1.flac and /a/b/y/2.flac (also note
> the trailing slash on the output prefix).  To do what you're
> describing you can do:
> 
> (cd /home/akehurst/tmp && flac --output-prefix=/usr/share/flac/
> my_file.wav)
> 
> But if I used the basename, the power of --output-prefix
> drops and I can no longer do the former.
> 
> Josh

Okay.  Thanks for the suggested workaround.

-Justin





More information about the Flac-dev mailing list