plugins/elements/gstfilesink.c: Set file to NULL when closing filesink so that we can set a new filename in READY. Fi...

Original commit message from CVS:
* plugins/elements/gstfilesink.c: (gst_file_sink_init),
(gst_file_sink_set_location), (gst_file_sink_open_file),
(gst_file_sink_close_file), (gst_file_sink_event),
(gst_file_sink_render):
Set file to NULL when closing filesink so that we can set a new filename
in READY. Fixes #358613.
This commit is contained in:
Wim Taymans 2006-10-02 09:41:09 +00:00
parent 86a6abe32d
commit 20f1785042
2 changed files with 21 additions and 6 deletions

View file

@ -1,3 +1,12 @@
2006-10-02 Wim Taymans <wim@fluendo.com>
* plugins/elements/gstfilesink.c: (gst_file_sink_init),
(gst_file_sink_set_location), (gst_file_sink_open_file),
(gst_file_sink_close_file), (gst_file_sink_event),
(gst_file_sink_render):
Set file to NULL when closing filesink so that we can set a new filename
in READY. Fixes #358613.
2006-10-02 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Alessandro Decina <alessandro at nnva org>

View file

@ -156,7 +156,7 @@ gst_file_sink_init (GstFileSink * filesink, GstFileSinkClass * g_class)
filesink->filename = NULL;
filesink->file = NULL;
GST_BASE_SINK (filesink)->sync = FALSE;
gst_base_sink_set_sync (GST_BASE_SINK (filesink), FALSE);
}
static void
@ -175,11 +175,8 @@ gst_file_sink_dispose (GObject * object)
static gboolean
gst_file_sink_set_location (GstFileSink * sink, const gchar * location)
{
if (sink->file) {
g_warning ("Changing the `location' property on filesink when "
"a file is open not supported.");
return FALSE;
}
if (sink->file)
goto was_open;
g_free (sink->filename);
g_free (sink->uri);
@ -192,6 +189,14 @@ gst_file_sink_set_location (GstFileSink * sink, const gchar * location)
}
return TRUE;
/* ERRORS */
was_open:
{
g_warning ("Changing the `location' property on filesink when "
"a file is open not supported.");
return FALSE;
}
}
static void
gst_file_sink_set_property (GObject * object, guint prop_id,
@ -269,6 +274,7 @@ gst_file_sink_close_file (GstFileSink * sink)
goto close_failed;
GST_DEBUG_OBJECT (sink, "closed file");
sink->file = NULL;
}
return;