From 2536cf7c57b1be881f699c6d537af9c498c99ef3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 8 May 2020 17:21:20 +0200 Subject: [PATCH] gstvalue: Fix segment (de)serialization By using the proper quarks (stored in the indirection table) and not the *enums* of those entry in the quark table. Part-of: --- gst/gstvalue.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 1bfe31db30..1a7f5a4e26 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -2765,15 +2765,19 @@ gst_value_serialize_segment_internal (const GValue * value, gboolean escape) gchar *t, *res; GstStructure *s; - s = gst_structure_new_id (GST_QUARK_SEGMENT, GST_QUARK_FLAGS, - GST_TYPE_SEGMENT_FLAGS, seg->flags, GST_QUARK_RATE, G_TYPE_DOUBLE, - seg->rate, GST_QUARK_APPLIED_RATE, G_TYPE_DOUBLE, seg->applied_rate, - GST_QUARK_FORMAT, GST_TYPE_FORMAT, seg->format, GST_QUARK_BASE, - G_TYPE_UINT64, seg->base, GST_QUARK_OFFSET, G_TYPE_UINT64, seg->offset, - GST_QUARK_START, G_TYPE_UINT64, seg->start, GST_QUARK_STOP, G_TYPE_UINT64, - seg->stop, GST_QUARK_TIME, G_TYPE_UINT64, seg->time, GST_QUARK_POSITION, - G_TYPE_UINT64, seg->position, GST_QUARK_DURATION, G_TYPE_UINT64, - seg->duration, NULL); + s = gst_structure_new_id (GST_QUARK (SEGMENT), + GST_QUARK (FLAGS), GST_TYPE_SEGMENT_FLAGS, seg->flags, + GST_QUARK (RATE), G_TYPE_DOUBLE, seg->rate, + GST_QUARK (APPLIED_RATE), G_TYPE_DOUBLE, seg->applied_rate, + GST_QUARK (FORMAT), GST_TYPE_FORMAT, seg->format, + GST_QUARK (BASE), G_TYPE_UINT64, seg->base, + GST_QUARK (OFFSET), G_TYPE_UINT64, seg->offset, + GST_QUARK (START), G_TYPE_UINT64, seg->start, + GST_QUARK (STOP), G_TYPE_UINT64, seg->stop, + GST_QUARK (TIME), G_TYPE_UINT64, seg->time, + GST_QUARK (POSITION), G_TYPE_UINT64, seg->position, + GST_QUARK (DURATION), G_TYPE_UINT64, seg->duration, NULL); + t = gst_structure_to_string (s); if (escape) { res = g_strdup_printf ("\"%s\"", t); @@ -2804,17 +2808,17 @@ gst_value_deserialize_segment (GValue * dest, const gchar * s) return FALSE; res = gst_structure_id_get (str, - GST_QUARK_FLAGS, GST_TYPE_SEGMENT_FLAGS, &seg.flags, - GST_QUARK_RATE, G_TYPE_DOUBLE, &seg.rate, - GST_QUARK_APPLIED_RATE, G_TYPE_DOUBLE, &seg.applied_rate, - GST_QUARK_FORMAT, GST_TYPE_FORMAT, &seg.format, - GST_QUARK_BASE, G_TYPE_UINT64, &seg.base, - GST_QUARK_OFFSET, G_TYPE_UINT64, &seg.offset, - GST_QUARK_START, G_TYPE_UINT64, &seg.start, - GST_QUARK_STOP, G_TYPE_UINT64, &seg.stop, - GST_QUARK_TIME, G_TYPE_UINT64, &seg.time, - GST_QUARK_POSITION, G_TYPE_UINT64, &seg.position, - GST_QUARK_DURATION, G_TYPE_UINT64, &seg.duration, NULL); + GST_QUARK (FLAGS), GST_TYPE_SEGMENT_FLAGS, &seg.flags, + GST_QUARK (RATE), G_TYPE_DOUBLE, &seg.rate, + GST_QUARK (APPLIED_RATE), G_TYPE_DOUBLE, &seg.applied_rate, + GST_QUARK (FORMAT), GST_TYPE_FORMAT, &seg.format, + GST_QUARK (BASE), G_TYPE_UINT64, &seg.base, + GST_QUARK (OFFSET), G_TYPE_UINT64, &seg.offset, + GST_QUARK (START), G_TYPE_UINT64, &seg.start, + GST_QUARK (STOP), G_TYPE_UINT64, &seg.stop, + GST_QUARK (TIME), G_TYPE_UINT64, &seg.time, + GST_QUARK (POSITION), G_TYPE_UINT64, &seg.position, + GST_QUARK (DURATION), G_TYPE_UINT64, &seg.duration, NULL); gst_structure_free (str); if (res)