- verbose("Running flac\n");
- $status = system('flac', '-o', "$outfile.flac-tmp",
- '--delete-input-file', '-V', '--no-padding', '--best',
- map({ ('-T', $_) }
- @lartist,
- grep({ $_ !~ /^ARTIST=/ } @tags),
- bork_tags($things{$tracknum})),
- sprintf('track%02d.cdda.wav', $tracknum));
- if (WIFEXITED($status)) {
- if (($status = WEXITSTATUS($status)) != 0) {
- die("flac exited with status $status");
- }
- } elsif (WIFSIGNALED($status)) {
- die("flac killed with signal ", WTERMSIG($status));
- } elsif (WIFSTOPPED($status)) {
- die("flac stopped with signal ", WSTOPSIG($status));
- } else {
- die("Major horkage on system(flac): \$? = $? \$! = $!");
- }
-
- rename("$outfile.flac-tmp", "$outfile.flac")
- or die("rename($outfile.flac-tmp, $outfile.flac): $!");
+ run_flac(sprintf('track%02d.cdda.wav', $tracknum), undef, $outfile,
+ @lartist,
+ grep({ $_ !~ /^ARTIST=/ } @tags),
+ bork_tags($things{$tracknum}));