From cf7d9f676d5af0958d048ab0113d2b8ca1675582 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sat, 4 Apr 2015 11:55:00 -0300 Subject: multifilesink: close files before posting message Makes sure the files were properly flushed and closed before the message reaches the application --- gst/multifile/gstmultifilesink.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gst') diff --git a/gst/multifile/gstmultifilesink.c b/gst/multifile/gstmultifilesink.c index c9fc2f55c..deaaea609 100644 --- a/gst/multifile/gstmultifilesink.c +++ b/gst/multifile/gstmultifilesink.c @@ -834,13 +834,12 @@ gst_multi_file_sink_event (GstBaseSink * sink, GstEvent * event) offset = offset_end = -1; filename = g_strdup_printf (multifilesink->filename, multifilesink->index); - gst_multi_file_sink_post_message_full (multifilesink, timestamp, - duration, offset, offset_end, running_time, stream_time, filename); - - g_free (filename); gst_multi_file_sink_close_file (multifilesink, NULL); + gst_multi_file_sink_post_message_full (multifilesink, timestamp, + duration, offset, offset_end, running_time, stream_time, filename); + g_free (filename); } if (multifilesink->file == NULL) { @@ -856,11 +855,12 @@ gst_multi_file_sink_event (GstBaseSink * sink, GstEvent * event) filename = g_strdup_printf (multifilesink->filename, multifilesink->index); + + gst_multi_file_sink_close_file (multifilesink, NULL); + gst_multi_file_sink_post_message_from_time (multifilesink, GST_BASE_SINK (multifilesink)->segment.position, -1, filename); g_free (filename); - - gst_multi_file_sink_close_file (multifilesink, NULL); } break; default: -- cgit v1.2.3