mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
filesink: Reset the current buffer size to NULL and clear the buffer on close and FLUSH_STOP
This commit is contained in:
parent
0a84fae16c
commit
cbcad53b45
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue