static GstElementStateReturn gst_disksrc_change_state (GstElement *element);
+static gboolean gst_disksrc_open_file (GstDiskSrc *src);
+static void gst_disksrc_close_file (GstDiskSrc *src);
static GstElementClass *parent_class = NULL;
//static guint gst_disksrc_signals[LAST_SIGNAL] = { 0 };
switch(id) {
case ARG_LOCATION:
- /* the element must be stopped in order to do this */
- g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
+ /* the element must be stopped or paused in order to do this */
+ g_return_if_fail ((GST_STATE (src) < GST_STATE_PLAYING)
+ || (GST_STATE (src) == GST_STATE_PAUSED));
if (src->filename) g_free (src->filename);
/* clear the filename if we get a NULL (is that possible?) */
} else {
src->filename = g_strdup (GTK_VALUE_STRING (*arg));
}
+ if ((GST_STATE (src) == GST_STATE_PAUSED) && (src->filename != NULL))
+ {
+ gst_disksrc_close_file(src);
+ gst_disksrc_open_file(src);
+ }
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);
static GstElementStateReturn gst_disksrc_change_state (GstElement *element);
+static gboolean gst_disksrc_open_file (GstDiskSrc *src);
+static void gst_disksrc_close_file (GstDiskSrc *src);
static GstElementClass *parent_class = NULL;
//static guint gst_disksrc_signals[LAST_SIGNAL] = { 0 };
switch(id) {
case ARG_LOCATION:
- /* the element must be stopped in order to do this */
- g_return_if_fail (GST_STATE (src) < GST_STATE_PLAYING);
+ /* the element must be stopped or paused in order to do this */
+ g_return_if_fail ((GST_STATE (src) < GST_STATE_PLAYING)
+ || (GST_STATE (src) == GST_STATE_PAUSED));
if (src->filename) g_free (src->filename);
/* clear the filename if we get a NULL (is that possible?) */
} else {
src->filename = g_strdup (GTK_VALUE_STRING (*arg));
}
+ if ((GST_STATE (src) == GST_STATE_PAUSED) && (src->filename != NULL))
+ {
+ gst_disksrc_close_file(src);
+ gst_disksrc_open_file(src);
+ }
break;
case ARG_BYTESPERREAD:
src->bytes_per_read = GTK_VALUE_INT (*arg);