diff --git a/ChangeLog b/ChangeLog index 9eff6e51d0..4184a3c398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-10-02 Wim Taymans + + * 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 Patch by: Alessandro Decina diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index ec00670192..a22136cecf 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -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;