After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771434 - ges-launch cannot not load files with square brackets in the file name
ges-launch cannot not load files with square brackets in the file name
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
1.8.3
Other Linux
: Normal normal
: 1.9.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-14 15:31 UTC by Antonio Ospite
Modified: 2016-09-30 07:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
structure-parser: Make sure to quote object identifiers (2.96 KB, patch)
2016-09-14 15:33 UTC, Thibault Saunier
needs-work Details | Review
ges-launch: Be a bit more agressive sanatizing arguments (1.60 KB, patch)
2016-09-14 17:36 UTC, Thibault Saunier
none Details | Review
ges-launch: Be a bit more agressive sanitizing arguments (1.67 KB, patch)
2016-09-14 17:41 UTC, Thibault Saunier
none Details | Review
ges-launch: Be a bit more agressive sanitizing arguments (1.45 KB, patch)
2016-09-14 21:22 UTC, Thibault Saunier
committed Details | Review

Description Antonio Ospite 2016-09-14 15:31:53 UTC
Hi,

as reported in the subject ges-launch cannot not load files with square brackets in the file name.

This works:

  $ gst-launch-1.0 videotestsrc num-buffers=100 ! jpegenc ! avimux ! filesink location=test.mjpeg
  $ ges-launch-1.0 +clip test.mjpg 
  <position: 0:00:03.267418000 duration: 0:00:03.333333334/>>
  Done

This does not:

  $ gst-launch-1.0 videotestsrc num-buffers=100 ! jpegenc ! avimux ! filesink location=test\[2\].mjpeg
  $ ges-launch-1.0 +clip test\[2\].mjpeg 

  ERROR: Could not create timeline because: Could not find a suitable formatter


Thanks,
   Antonio
Comment 1 Thibault Saunier 2016-09-14 15:33:56 UTC
Created attachment 335536 [details] [review]
structure-parser: Make sure to quote object identifiers

Otherwise the GstStructure might fail on some chars
(for example a filename with brackets fails).
Comment 2 Mathieu Duponchelle 2016-09-14 15:39:33 UTC
Review of attachment 335536 [details] [review]:

::: ges/ges-structure-parser.c
@@ -120,3 +124,3 @@
     symbol++;
 
   self->add_comma = FALSE;

set self->add_quote = TRUE here

@@ -123,8 +127,14 @@
-  if (!g_ascii_strncasecmp (symbol, "clip", 4))
-    ges_structure_parser_parse_string (self, "clip, uri=", TRUE);
-  else if (!g_ascii_strncasecmp (symbol, "test-clip", 9))
... 5 more ...
+  if (!g_ascii_strncasecmp (symbol, "clip", 4)) {
+    self->add_quote = TRUE;
+    ges_structure_parser_parse_string (self, "clip, uri=\"", TRUE);
... 11 more ...

and set it to FALSE in an else clause there ;)
Comment 3 Thibault Saunier 2016-09-14 17:36:21 UTC
Created attachment 335562 [details] [review]
ges-launch: Be a bit more agressive sanatizing arguments
Comment 4 Thibault Saunier 2016-09-14 17:41:59 UTC
Created attachment 335563 [details] [review]
ges-launch: Be a bit more agressive sanitizing arguments

Otherwise GstStructure might fail parsing some fields
containing brackets
Comment 5 Thibault Saunier 2016-09-14 21:22:09 UTC
Created attachment 335572 [details] [review]
ges-launch: Be a bit more agressive sanitizing arguments

Otherwise GstStructure might fail parsing some fields
containing brackets
Comment 6 Mathieu Duponchelle 2016-09-14 21:29:16 UTC
Review of attachment 335572 [details] [review]:

Accepted
Comment 7 Mathieu Duponchelle 2016-09-14 21:31:43 UTC
Review of attachment 335572 [details] [review]:

will break with "uri=that_breaks"
Comment 8 Thibault Saunier 2016-09-14 21:36:55 UTC
Attachment 335572 [details] pushed as 244266a - ges-launch: Be a bit more agressive sanitizing arguments