Commit f93b9df8 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

gio: Make sure to flush the output stream if it shouldn't be closed

Otherwise there might still be unwritten data after the element
has stopped.
parent 1c0123cf
......@@ -159,6 +159,19 @@ gst_gio_base_sink_stop (GstBaseSink * base_sink)
g_object_unref (sink->stream);
sink->stream = NULL;
} else {
success = g_output_stream_flush (sink->stream, sink->cancel, &err);
if (!success && !gst_gio_error (sink, "g_output_stream_flush", &err, NULL)) {
GST_ELEMENT_WARNING (sink, RESOURCE, CLOSE, (NULL),
("gio_output_stream_flush failed: %s", err->message));
g_clear_error (&err);
} else if (!success) {
GST_ELEMENT_WARNING (sink, RESOURCE, CLOSE, (NULL),
("g_output_stream_flush failed"));
} else {
GST_DEBUG_OBJECT (sink, "g_outut_stream_flush succeeded");
}
g_object_unref (sink->stream);
sink->stream = NULL;
}
......
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