From abe959c7713141b8ab30128794c8af9672814c4f Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 1 Jun 2001 15:29:03 +0000 Subject: [PATCH] coded small bit in to allow changing of output location Original commit message from CVS: coded small bit in to allow changing of output location --- gst/elements/gstdisksink.c | 10 ++++++++++ plugins/elements/gstdisksink.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/gst/elements/gstdisksink.c b/gst/elements/gstdisksink.c index 0861149..b47f783 100644 --- a/gst/elements/gstdisksink.c +++ b/gst/elements/gstdisksink.c @@ -135,9 +135,19 @@ gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id) switch(id) { case ARG_LOCATION: + /* the element must be stopped or paused in order to do this */ + g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING) + || (GST_STATE (sink) == GST_STATE_PAUSED)); if (sink->filename) g_free (sink->filename); sink->filename = g_strdup (GTK_VALUE_STRING (*arg)); + if ( (GST_STATE (sink) == GST_STATE_PAUSED) + && (sink->filename != NULL)) + { + gst_disksink_close_file (sink); + gst_disksink_open_file (sink); + } + break; default: break; diff --git a/plugins/elements/gstdisksink.c b/plugins/elements/gstdisksink.c index 0861149..b47f783 100644 --- a/plugins/elements/gstdisksink.c +++ b/plugins/elements/gstdisksink.c @@ -135,9 +135,19 @@ gst_disksink_set_arg (GtkObject *object, GtkArg *arg, guint id) switch(id) { case ARG_LOCATION: + /* the element must be stopped or paused in order to do this */ + g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING) + || (GST_STATE (sink) == GST_STATE_PAUSED)); if (sink->filename) g_free (sink->filename); sink->filename = g_strdup (GTK_VALUE_STRING (*arg)); + if ( (GST_STATE (sink) == GST_STATE_PAUSED) + && (sink->filename != NULL)) + { + gst_disksink_close_file (sink); + gst_disksink_open_file (sink); + } + break; default: break; -- 2.7.4