Commit cbcad53b authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

filesink: Reset the current buffer size to NULL and clear the buffer on close and FLUSH_STOP

parent 0a84fae1
......@@ -389,6 +389,7 @@ gst_file_sink_open_file (GstFileSink * sink)
}
sink->buffer = gst_buffer_list_new ();
sink->current_buffer_size = 0;
}
GST_DEBUG_OBJECT (sink, "opened file %s, seekable %d",
......@@ -432,6 +433,7 @@ gst_file_sink_close_file (GstFileSink * sink)
gst_buffer_list_unref (sink->buffer);
sink->buffer = NULL;
}
sink->current_buffer_size = 0;
}
static gboolean
......@@ -578,6 +580,11 @@ gst_file_sink_event (GstBaseSink * sink, GstEvent * event)
if (ftruncate (fileno (filesink->file), 0))
goto truncate_failed;
}
if (filesink->buffer) {
gst_buffer_list_unref (filesink->buffer);
filesink->buffer = gst_buffer_list_new ();
filesink->current_buffer_size = 0;
}
break;
case GST_EVENT_EOS:
if (gst_file_sink_flush_buffer (filesink) != GST_FLOW_OK)
......
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