mirror of
https://github.com/fmang/opustags.git
synced 2025-07-13 12:35:43 +02: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:
@ -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)
|
||||
|
Reference in New Issue
Block a user