MkvMerge: Error message 112 (There is not enough space on the disk.) printed twice #1850

Closed
elgonzo opened this Issue Jan 7, 2017 · 1 comment

Projects

None yet

2 participants

@elgonzo
elgonzo commented Jan 7, 2017 edited

I consider this mostly a minor cosmetic issue.

When muxing a video with MkvMerge to a target drive which does not have enough space available, MkvMerge will print the error message Error: Could not write to the destination file: 112 (There is not enough space on the disk.) twice. This will also cause the MKVToolNix GUI to report two errors in its status bar, although only one error happened.

Double-printing of the error message seems to be specific to this particular error (and perhaps to other write-related errors, i guess). I tested writing to a non-writable target (DVD drive), and in that case the error message ("open file error") was given only once, as one would expect.

My setup:
mkvmerge v9.7.1 ('Pandemonium') 64bit
Windows 7 Pro x64, english

@mbunkus
Owner
mbunkus commented Jan 7, 2017

Thanks. I'll look into it.

@mbunkus mbunkus added a commit that closed this issue Jan 7, 2017
@mbunkus mkvmerge cleanup: discard write buffer content in error situations
This prevents the error message "not enough space on disk" being shown
twice.

Whenever a write fails, an exception is throw, and an appropriate error
message is shown. This is the first time.

Next mkvmerge goes into its cleanup routine. There it closes the output
file. The output file uses a write buffer implementation. Before closing
the file any outstanding buffered content is written to the disk. The
disk is still full, though, triggering another exception, and another
error message is output.

The workaround is to discard any buffered content still remaining at
cleanup time. This is safe as the output file is closed manually normal
program flow. Therefore no buffered content is lost in a successful run.

Fixes #1850.
87caecc
@mbunkus mbunkus closed this in 87caecc Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment