Initialize variables when creating a new segment query.

Original commit message from CVS:
Patch by: Torsten Schoenfeld <kaffeetisch at gmx dot de>
* gst/gstquery.c: (gst_query_new_segment):
* tests/check/gst/gstquery.c: (GST_START_TEST):
Initialize variables when creating a new segment query.
Fixes #353121.
This commit is contained in:
Torsten Schoenfeld 2006-08-28 08:44:29 +00:00 committed by Wim Taymans
parent 7fc02489e3
commit 481238cfce
3 changed files with 33 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2006-08-28 Wim Taymans <wim@fluendo.com>
Patch by: Torsten Schoenfeld <kaffeetisch at gmx dot de>
* gst/gstquery.c: (gst_query_new_segment):
* tests/check/gst/gstquery.c: (GST_START_TEST):
Initialize variables when creating a new segment query.
Fixes #353121.
2006-08-28 Wim Taymans <wim@fluendo.com>
Patch by: Torsten Schoenfeld <kaffeetisch at gmx dot de>

View file

@ -647,7 +647,10 @@ gst_query_new_segment (GstFormat format)
structure = gst_structure_empty_new ("GstQuerySegment");
gst_structure_id_set (structure,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format, NULL);
GST_QUARK (RATE), G_TYPE_DOUBLE, (gdouble) 0.0,
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
GST_QUARK (START_VALUE), G_TYPE_INT64, (gint64) - 1,
GST_QUARK (STOP_VALUE), G_TYPE_INT64, (gint64) - 1, NULL);
query = gst_query_new (GST_QUERY_SEGMENT, structure);

View file

@ -73,6 +73,26 @@ GST_START_TEST (create_queries)
* CONVERT
*/
}
/* SEGMENT */
{
gdouble rate;
GstFormat format;
gint64 start, stop;
format = GST_FORMAT_TIME;
query = gst_query_new_segment (format);
fail_if (query == NULL);
fail_unless (GST_QUERY_TYPE (query) == GST_QUERY_SEGMENT);
gst_query_parse_segment (query, &rate, &format, &start, &stop);
/* see if empty gives undefined formats */
fail_if (rate == 1.0);
fail_if (format != GST_FORMAT_TIME);
fail_if (start != -1);
fail_if (stop != -1);
}
/* FORMATS */
{