summaryrefslogtreecommitdiff
path: root/gst/multifile/gstmultifilesink.c
diff options
context:
space:
mode:
authorAurélien Zanelli <aurelien.zanelli@parrot.com>2016-02-22 11:01:40 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-02-23 11:34:31 +0200
commit84e441d2685cf223d348a95be0c5ba693bbf6624 (patch)
tree8785dd0ef77a74aff10f9f0d7c5fa39a5b850aac /gst/multifile/gstmultifilesink.c
parent8657987f8f9e659a7207f5d69fdc679f5ff8f24e (diff)
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
Diffstat (limited to 'gst/multifile/gstmultifilesink.c')
-rw-r--r--gst/multifile/gstmultifilesink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/multifile/gstmultifilesink.c b/gst/multifile/gstmultifilesink.c
index c74c20bdd..5d2878662 100644
--- a/gst/multifile/gstmultifilesink.c
+++ b/gst/multifile/gstmultifilesink.c
@@ -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;