mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
Some adjustments to allow for setting a new filename after EOS, useful for writing multiple files
Original commit message from CVS: Some adjustments to allow for setting a new filename after EOS, useful for writing multiple files
This commit is contained in:
parent
04471c9cdd
commit
fdba81e0fa
2 changed files with 10 additions and 10 deletions
|
@ -168,15 +168,15 @@ gst_filesink_set_property (GObject *object, guint prop_id, const GValue *value,
|
|||
switch (prop_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);
|
||||
g_return_if_fail (GST_STATE (sink) <= GST_STATE_PAUSED);
|
||||
if (GST_STATE (sink) == GST_STATE_PAUSED)
|
||||
g_return_if_fail (!GST_FLAG_IS_SET (sink, GST_FILESINK_OPEN));
|
||||
|
||||
if (sink->filename)
|
||||
g_free (sink->filename);
|
||||
sink->filename = g_strdup (g_value_get_string (value));
|
||||
if ((GST_STATE (sink) == GST_STATE_PAUSED) &&
|
||||
(sink->filename != NULL)) {
|
||||
gst_filesink_close_file (sink);
|
||||
if (GST_STATE (sink) == GST_STATE_PAUSED)
|
||||
gst_filesink_open_file (sink);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
|
@ -168,15 +168,15 @@ gst_filesink_set_property (GObject *object, guint prop_id, const GValue *value,
|
|||
switch (prop_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);
|
||||
g_return_if_fail (GST_STATE (sink) <= GST_STATE_PAUSED);
|
||||
if (GST_STATE (sink) == GST_STATE_PAUSED)
|
||||
g_return_if_fail (!GST_FLAG_IS_SET (sink, GST_FILESINK_OPEN));
|
||||
|
||||
if (sink->filename)
|
||||
g_free (sink->filename);
|
||||
sink->filename = g_strdup (g_value_get_string (value));
|
||||
if ((GST_STATE (sink) == GST_STATE_PAUSED) &&
|
||||
(sink->filename != NULL)) {
|
||||
gst_filesink_close_file (sink);
|
||||
if (GST_STATE (sink) == GST_STATE_PAUSED)
|
||||
gst_filesink_open_file (sink);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
Loading…
Reference in a new issue