Justin Akehurst
2004-Sep-10 16:45 UTC
[Flac-dev] Proposed change to code that handles output_prefix
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. -Justin Akehurst akehurst-flac@poindextrose.org
Josh Coalson
2004-Sep-10 16:45 UTC
[Flac-dev] Proposed change to code that handles output_prefix
--- Justin Akehurst <akehurst@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 __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
Justin Akehurst
2004-Sep-10 16:45 UTC
[Flac-dev] Proposed change to code that handles output_prefix
On Tue, 20 Aug 2002, Josh Coalson wrote:> --- Justin Akehurst <akehurst@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. > > JoshOkay. Thanks for the suggested workaround. -Justin