GNOME Bugzilla – Bug 746354
Malformed XGES syntax detection problems
Last modified: 2015-06-24 14:42:57 UTC
Created attachment 299610 [details] invalid xges file For file I attached to this report ges_project_new returns me a project, ges_asset_extract returns me non-null pipeline, and error isn't set. So I can add this timeline to GesPipeline and have no way to understand that rednering is failed. However, for simplest syntax errors like empty file or some trash instead of XML, timeline is null and I have something like this in my console: 0:00:14.690729768 20443 0xfe0f90 ERROR ges_pitivi_formatter ges-pitivi-formatter.c:114:pitivi_can_load_uri: The xptv file for uri file:///mnt/cvd/p1.xges was badly formed or did not exist I want something like that to detect malformed input files automatically.
Why makes you think there is a syntax error in that file? The error you show (which does not happen in the case you describe here) is from the pitivi formatter (which we do not really care about).
>> Why makes you think there is a syntax error in that file? I even didn't finished <timeli tag, other XML tags aren't finished. >> The error you show (which does not happen in the case you describe here) is from the pitivi formatter (which we do not really care about). Yes, but I have this error message when trying to open empty file via ges_project_new/ges_asset_extract.
Sorry I did not actually had a look at the file itself. Basically we should just make sure that we call g_markup_parse_context_end_parse so that it detects the XML does not properly end. Patch available at: http://phabricator.freedesktop.org/D38
Looks good, I'll test it tonight.
Unfortunately, there are others XGES syntax issues (deeper than XML level) without option to understand, if GesProject is correctly formed. For example, document can be XML-valid but have wrong attributes, filter names, properties, etc. In this case GesPipeline hangs and no chance for app to handle this.
The parser is usually pretty strict when parsing as it uses g_markup_collect_attributes. Wrong properties or filter will be catched through project error signals.
> Wrong properties or filter will be catched through project error signals. Namely GESProjectr::error-loading-asset
ges:xml-formatter: Call g_markup_parse_context_end_parse Summary: Otherwise the parser context will never know that is all the XML it will receive and fail out if the XML document is not valid (in that case if it does not end) https://bugzilla.gnome.org/show_bug.cgi?id=746354 Reviewers: Mathieu_Du Reviewed By: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D38
And the hash: a300ba7a644163e74984c11418c4651431