multifilesink: close files before posting message

Makes sure the files were properly flushed and closed before
the message reaches the application
This commit is contained in:
Thiago Santos 2015-04-04 11:55:00 -03:00
parent 00e5d90ffc
commit cf7d9f676d

View file

@ -834,13 +834,12 @@ gst_multi_file_sink_event (GstBaseSink * sink, GstEvent * event)
offset = offset_end = -1; offset = offset_end = -1;
filename = g_strdup_printf (multifilesink->filename, filename = g_strdup_printf (multifilesink->filename,
multifilesink->index); 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_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) { if (multifilesink->file == NULL) {
@ -856,11 +855,12 @@ gst_multi_file_sink_event (GstBaseSink * sink, GstEvent * event)
filename = g_strdup_printf (multifilesink->filename, filename = g_strdup_printf (multifilesink->filename,
multifilesink->index); multifilesink->index);
gst_multi_file_sink_close_file (multifilesink, NULL);
gst_multi_file_sink_post_message_from_time (multifilesink, gst_multi_file_sink_post_message_from_time (multifilesink,
GST_BASE_SINK (multifilesink)->segment.position, -1, filename); GST_BASE_SINK (multifilesink)->segment.position, -1, filename);
g_free (filename); g_free (filename);
gst_multi_file_sink_close_file (multifilesink, NULL);
} }
break; break;
default: default: