mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
aconv: Copy metadata to output
This requires postponing FLAC header finalization, since FLAC cannot write metadata after a finalized header.
This commit is contained in:
parent
1e291753b0
commit
4c9c2104f3
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/4c9c2104f3 Pull-request: https://github.com/SerenityOS/serenity/pull/20650
1 changed files with 7 additions and 2 deletions
|
@ -134,15 +134,20 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
static_cast<int>(input_loader->sample_rate()),
|
||||
input_loader->num_channels(),
|
||||
Audio::pcm_bits_per_sample(parsed_output_sample_format)));
|
||||
TRY(flac_writer->finalize_header_format());
|
||||
writer.emplace(move(flac_writer));
|
||||
} else {
|
||||
warnln("Codec {} is not supported for encoding", output_format);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (writer.has_value())
|
||||
if (writer.has_value()) {
|
||||
(*writer)->sample_count_hint(input_loader->total_samples());
|
||||
TRY((*writer)->set_metadata(input_loader->metadata()));
|
||||
}
|
||||
|
||||
// FIXME: Maybe use a generalized interface for this as well if the need arises.
|
||||
if (output_format == "flac"sv)
|
||||
TRY(static_cast<Audio::FlacWriter*>(writer->ptr())->finalize_header_format());
|
||||
|
||||
if (output != "-"sv)
|
||||
out("Writing: \033[s");
|
||||
|
|
Loading…
Reference in a new issue