summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Zanelli <aurelien.zanelli@parrot.com>2016-02-22 11:01:40 +0100
committerTim-Philipp Müller <tim@centricular.com>2016-04-06 11:19:27 +0100
commit165a71c040a4e4f5f8016246b692da2faf0760ac (patch)
treee9e5666d43770942dc3a051b1d6abadb23a906a1
parentb303e6ec0e64b872f82c2938758717dad8f977cd (diff)
downloadgstreamer-plugins-good-165a71c040a4e4f5f8016246b692da2faf0760ac.tar.gz
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
-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 ebc22c265..9ce08bbb5 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;