validate: Properly use boolean in XML

This commit is contained in:
Thibault Saunier 2014-05-15 09:46:24 +02:00
parent 92d390bc5d
commit 9660a8bd3a
2 changed files with 12 additions and 8 deletions

View file

@ -55,7 +55,7 @@ compare_frames (FrameNode * frm, FrameNode * frm1)
}
static void
deserialize_filenode (FileNode *filenode,
deserialize_filenode (FileNode * filenode,
const gchar ** names, const gchar ** values)
{
gint i;
@ -134,8 +134,12 @@ deserialize_framenode (const gchar ** names, const gchar ** values)
framenode->pts = g_ascii_strtoull (values[i], NULL, 0);
else if (g_strcmp0 (names[i], "dts") == 0)
framenode->dts = g_ascii_strtoull (values[i], NULL, 0);
else if (g_strcmp0 (names[i], "is-keyframe") == 0)
framenode->is_keyframe = g_ascii_strtoull (values[i], NULL, 0);
else if (g_strcmp0 (names[i], "is-keyframe") == 0) {
if (g_ascii_strcasecmp (values[i], "true"))
framenode->is_keyframe = TRUE;
else
framenode->is_keyframe = FALSE;
}
}
framenode->buf = gst_buffer_new ();

View file

@ -464,8 +464,8 @@ _run_frame_analisis (GstMediaDescriptorWriter * writer,
writer->priv->pipeline = gst_pipeline_new ("frame-analisis");
monitor =
gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer->priv->
pipeline), runner, NULL);
gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer->
priv->pipeline), runner, NULL);
gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor));
g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL);
@ -735,11 +735,11 @@ gst_media_descriptor_writer_add_frame (GstMediaDescriptorWriter
fnode->str_open =
g_markup_printf_escaped (" <frame duration=\"%" G_GUINT64_FORMAT
"\" id=\"%i\" is-keyframe=\"%i\" offset=\"%" G_GUINT64_FORMAT
"\" id=\"%i\" is-keyframe=\"%s\" offset=\"%" G_GUINT64_FORMAT
"\" offset-end=\"%" G_GUINT64_FORMAT "\" pts=\"%" G_GUINT64_FORMAT
"\" dts=\"%" G_GUINT64_FORMAT "\" />", fnode->duration, id,
fnode->is_keyframe, fnode->offset, fnode->offset_end, fnode->pts,
fnode->dts);
fnode->is_keyframe ? "true" : "false",
fnode->offset, fnode->offset_end, fnode->pts, fnode->dts);
fnode->str_close = NULL;