summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-08-13 17:29:58 +0100
committerTim-Philipp Müller <tim@centricular.com>2015-08-18 13:17:34 +0100
commit29afa758589620f4572ca2f1bbbac073318df071 (patch)
tree99a9c503244f8fb7d600937d5cdc3715b3e4f35a
parent5d99d0dfa0a2b7fdedb26cc02de6c5dc74f09ddd (diff)
multifilesrc: fix regression with starting from index set via index property
When we haven't started yet, set the start_index when we set the index property, so that we start at the right index position after the initial seek. The index property was never really meant to be for writing, but it used to work, so let's support it for backwards compatibility. https://bugzilla.gnome.org/show_bug.cgi?id=739472
-rw-r--r--gst/multifile/gstmultifilesrc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c
index 01dae987a..316c6e0e1 100644
--- a/gst/multifile/gstmultifilesrc.c
+++ b/gst/multifile/gstmultifilesrc.c
@@ -299,7 +299,14 @@ gst_multi_file_src_set_property (GObject * object, guint prop_id,
gst_multi_file_src_set_location (src, g_value_get_string (value));
break;
case PROP_INDEX:
- src->index = g_value_get_int (value);
+ GST_OBJECT_LOCK (src);
+ /* index was really meant to be read-only, but for backwards-compatibility
+ * we set start_index to make it work as it used to */
+ if (!GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED))
+ src->start_index = g_value_get_int (value);
+ else
+ src->index = g_value_get_int (value);
+ GST_OBJECT_UNLOCK (src);
break;
case PROP_START_INDEX:
src->start_index = g_value_get_int (value);