+ char *opt = NULL;
+ if (!strcmp (device, "default"))
+ device = "iec958"; /* TODO: hdmi */
+ else
+ {
+ opt = strchr(device, ':');
+ if (opt && opt[1] == '\0') {
+ /* if device is terminated by : but there's no options,
+ * remove ':', we'll add it back in the format string. */
+ *opt = '\0';
+ opt = NULL;
+ }
+ }
+