mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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.
This commit is contained in:
parent
1c0123cf58
commit
f93b9df83d
1 changed files with 13 additions and 0 deletions
|
@ -159,6 +159,19 @@ gst_gio_base_sink_stop (GstBaseSink * base_sink)
|
||||||
g_object_unref (sink->stream);
|
g_object_unref (sink->stream);
|
||||||
sink->stream = NULL;
|
sink->stream = NULL;
|
||||||
} else {
|
} 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);
|
g_object_unref (sink->stream);
|
||||||
sink->stream = NULL;
|
sink->stream = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue