mirror of
https://github.com/fmang/opustags.git
synced 2025-01-15 12:43:17 +01:00
Flush the writer before exec’ing
In the unlikely event the child process fails without exec’ing, we don’t want both the child process and parent process to flush the OpusHead header. Thanks @omar-polo for reporting this!
This commit is contained in:
parent
d071b6cabd
commit
57a4c0d5a0
@ -382,9 +382,11 @@ static ot::status process(ot::ogg_reader& reader, ot::ogg_writer* writer, const
|
||||
if ((rc = edit_tags(tags, opt)) != ot::st::ok)
|
||||
return rc;
|
||||
if (writer) {
|
||||
if (opt.edit_interactively &&
|
||||
(rc = edit_tags_interactively(tags, writer->path)) != ot::st::ok)
|
||||
return rc;
|
||||
if (opt.edit_interactively) {
|
||||
fflush(writer->file); // flush before calling the subprocess
|
||||
if ((rc = edit_tags_interactively(tags, writer->path)) != ot::st::ok)
|
||||
return rc;
|
||||
}
|
||||
auto packet = ot::render_tags(tags);
|
||||
rc = writer->write_header_packet(serialno, pageno, packet);
|
||||
if (rc != ot::st::ok)
|
||||
|
Loading…
x
Reference in New Issue
Block a user