From 20f1785042507beb5a18b063f54d064915ae7a0d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 2 Oct 2006 09:41:09 +0000 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ plugins/elements/gstfilesink.c | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) 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;