Commit 84e441d2 authored by Aurélien Zanelli's avatar Aurélien Zanelli Committed by Sebastian Dröge

multifilesink: close file on write error with next-file mode is set to buffer

If we have an error during fwrite call, file stays open and thus next
incoming buffer will trigger an assert when trying to opening a new
file.
This happens if we do not restart element, file is closed at stop, and
if application handles the returned GST_FLOW_ERROR to keep bin alive.

https://bugzilla.gnome.org/show_bug.cgi?id=762434
parent 8657987f
......@@ -627,8 +627,10 @@ gst_multi_file_sink_write_buffer (GstMultiFileSink * multifilesink,
"Writing buffer data (%" G_GSIZE_FORMAT " bytes) to new file",
map.size);
ret = fwrite (map.data, map.size, 1, multifilesink->file);
if (ret != 1)
if (ret != 1) {
gst_multi_file_sink_close_file (multifilesink, NULL);
goto stdio_write_error;
}
gst_multi_file_sink_close_file (multifilesink, buffer);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment